/* ============================================================
   TELA DE LOGIN — RESPONSIVO (JANELAS BAIXAS, MOBILE E RETINA)
   Parte 8/9 da antiga style.css (linhas 2604–2887 do original).
   A ordem das <link> no index.html repete a ordem original do arquivo,
   então a cascata é exatamente a mesma de antes da divisão.
   ============================================================ */

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .login-page {
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
  }
  .container {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .brand {
    flex: 0 0 auto;
    padding: 16px 24px 8px;
    gap: 6px;
  }
  .crown {
    width: 90px;
  }
  .crown-secret-box {
    top: 126px;
  }
  .brand-divider {
    display: none;
  }
  .brand-text {
    width: auto;
    height: auto;
    max-width: 320px;
  }
  .brand-title {
    font-size: 1.6rem;
    margin-bottom: 3px;
  }
  .brand-tagline {
    font-size: 0.78rem;
    /* altura fixa: o filho é position:absolute e não sustenta a altura do pai */
    height: 3em;
  }
  .form-side {
    flex: 1;
    width: 100%;
    padding: 8px 24px 16px;
  }
  .login-card {
    padding: 18px 20px;
    max-width: 100%;
    border-radius: 20px;
  }
  .card-header { margin-bottom: 14px; }
  .card-header h2 { font-size: 1.2rem; }
  .card-header p { font-size: 0.78rem; }
  .field { margin-bottom: 12px; }
  .input-wrapper input { padding: 10px 42px 10px 40px; font-size: 0.9rem; min-height: 44px; }
  .row-between { margin-bottom: 12px; }
  .checkbox-label { font-size: 0.82rem; }
  .btn-login { padding: 11px; min-height: 46px; font-size: 0.9rem; }
  .strength-meter { margin-top: 3px; }
  .social-buttons { flex-direction: row; gap: 8px; }
  .btn-social { padding: 9px; min-height: 42px; font-size: 0.82rem; }
  .toggle-pw { width: 38px; height: 38px; }
  .divider { margin: 12px 0; }
  .signup-text { margin-top: 10px; font-size: 0.76rem; }
  .login-footer { margin-top: 8px; }
  .login-footer p { font-size: 0.62rem; }
  .footer-line { width: 24px; }

  /* Register responsive */
  /* clip no eixo X: o brilho decorativo (::before) é mais largo que a tela
     e não deve gerar rolagem horizontal */
  .register-alt-page { align-items: flex-start; overflow-x: clip; }
  .register-alt-container {
    flex-direction: column;
    max-width: 440px;
    height: auto;
    gap: 0;
  }
  .register-alt-brand {
    flex: 0 0 auto;
    border-radius: 28px 28px 0 0;
    padding: 16px 20px 10px;
    border-right: 1px solid rgba(139, 92, 246, 0.12);
    border-bottom: none;
    gap: 4px;
  }
  .register-alt-crown { width: 60px; }
  .register-alt-divider { margin: 6px 0; }
  .register-alt-brand-title { font-size: 1.4rem; }
  .register-alt-brand-text { margin: 4px 0 10px; }
  .register-alt-tagline { font-size: 0.7rem; height: 2.2em; }
  .register-alt-form-side { flex: 1; min-height: 0; overflow: hidden; }
  .register-alt-card {
    border-radius: var(--radius-card);
    padding: 16px 20px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    max-width: 100%;
  }
  .register-alt-card-header { margin-bottom: 14px; }
  .register-alt-card-header h2 { font-size: 1.2rem; }
  .register-alt-field { margin-bottom: 12px; }
  .register-alt-input-wrapper input { padding: 10px 42px 10px 40px; font-size: 0.9rem; min-height: 44px; }
  .register-alt-btn { padding: 11px; min-height: 46px; font-size: 0.9rem; margin-top: 10px; }
  .register-alt-terms-notice { margin: 6px 0 8px; }
  .register-alt-divider-text { margin: 12px 0 10px; }
  .register-alt-social-buttons { gap: 8px; }
  .register-alt-btn-social { padding: 8px; font-size: 0.78rem; }
  .register-alt-login-text { margin-top: 10px; }
}

@media (max-width: 480px) {
  /* ==========================================================
     CELULAR — layout "tela cheia estilo app":
     sem cartão de vidro; marca imersiva no topo, campos grandes
     soltos na tela e botões sociais empilhados em largura total.
     Tudo compacto o bastante pra caber sem rolagem.
     ========================================================== */
  /* respiro no topo respeitando notch/safe-area; a coroa flutua
     menos (-4px em vez de -10px) pra nunca colar na borda */
  .brand { padding: calc(18px + env(safe-area-inset-top)) 16px 4px; gap: 6px; }
  .crown.is-floating {
    animation: crownFloatMob 5s ease-in-out infinite;
  }
  .crown { width: 72px; }
  .crown-secret-box { top: 86px; padding: 10px 12px; gap: 4px; }
  .brand-text { width: 100%; height: auto; }
  .brand-title { font-size: 1.7rem; margin-bottom: 3px; }
  .brand-tagline { font-size: 0.78rem; height: 2.4em; line-height: 1.35; padding: 0 4px; }

  .form-side { padding: 8px 18px 6px; }

  /* Cartão vira transparente: o conteúdo vive direto na tela */
  .login-card {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 0;
  }
  .card-header { margin-bottom: 12px; text-align: center; }
  .card-header h2 { font-size: 1.3rem; }
  .card-header p { font-size: 0.85rem; }

  /* Campos grandes e soltos */
  .field { margin-bottom: 9px; }
  .field label { font-size: 0.7rem; margin-bottom: 3px; }
  .input-wrapper input {
    padding: 11px 16px 11px 46px;
    font-size: 1rem; /* 16px evita o zoom automático do iOS ao focar */
    min-height: 47px;
    border-radius: 14px;
  }
  .input-icon { left: 15px; }
  .toggle-pw { width: 38px; height: 38px; right: 7px; }
  .row-between { margin-bottom: 9px; }
  .checkbox-label { font-size: 0.85rem; gap: 9px; }

  .btn-login {
    padding: 12px;
    min-height: 49px;
    font-size: 1rem;
    border-radius: 14px;
  }

  /* Sociais como bolinhas de ícone, lado a lado */
  .social-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px; }
  .btn-social {
    flex: 0 0 auto;
    width: 54px; height: 54px; min-height: 54px;
    padding: 0; border-radius: 50%;
    font-size: 0; /* esconde o texto; o ícone fica sozinho na bolinha */
    gap: 0;
  }
  .btn-social svg { width: 22px; height: 22px; }

  .divider { margin: 11px 0; }
  .signup-text { margin-top: 10px; font-size: 0.85rem; }
  .login-footer { margin-top: 8px; }
  .login-footer p { font-size: 0.68rem; }
  .footer-line { width: 20px; }

  /* Register mobile — mesmo tratamento tela cheia */
  /* sem padding na página: devolve 32px úteis de tela */
  .register-alt-page { padding: 0; }
  .register-alt-container { padding: 0; max-width: 100%; }
  .register-alt-brand { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .register-alt-crown { width: 56px; }
  .register-alt-crown.is-floating {
    animation: crownFloatMob 5s ease-in-out infinite;
  }
  .register-alt-brand-title { font-size: 1.7rem; }
  /* altura fixa do desktop atrapalha no mobile: libera pro conteúdo */
  .register-alt-brand-text { height: auto; min-height: 0; margin: 2px 0 6px; }
  .register-alt-tagline { font-size: 0.78rem; height: 2.4em; }
  .register-alt-form-side { padding: 6px 18px 4px; overflow: visible; }
  .register-alt-card {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 0;
  }
  .register-alt-card-header { margin-bottom: 10px; text-align: center; }
  .register-alt-card-header h2 { font-size: 1.3rem; }
  .register-alt-card-header p { font-size: 0.85rem; }
  .register-alt-field { margin-bottom: 6px; }
  .register-alt-field label { font-size: 0.7rem; }
  .register-alt-input-wrapper input {
    padding: 11px 16px 11px 46px;
    font-size: 1rem;
    min-height: 47px;
    border-radius: 14px;
  }
  .register-alt-input-icon { left: 15px; width: 17px; height: 17px; }
  .register-alt-toggle-pw { width: 38px; height: 38px; }
  .register-alt-btn { padding: 12px; min-height: 49px; font-size: 1rem; border-radius: 14px; margin-top: 6px; }
  .register-alt-terms-notice { margin: 2px 0 4px; }
  .register-alt-terms-notice p { font-size: 0.66rem; line-height: 1.25; }
  .register-alt-divider-text { margin: 6px 0 4px; }
  .register-alt-social-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px; }
  .register-alt-btn-social {
    flex: 0 0 auto;
    width: 48px; height: 48px; min-height: 48px;
    padding: 0; border-radius: 50%;
    font-size: 0;
    gap: 0;
  }
  .register-alt-btn-social svg { width: 20px; height: 20px; }
  .register-alt-login-text { margin-top: 8px; }
}

/* Telas de celular curtas (<800px de altura): comprime o cadastro
   ainda mais pra continuar cabendo sem rolagem */
@media (max-width: 480px) and (max-height: 800px) {
  .register-alt-crown { width: 48px; }
  .register-alt-tagline { display: none; }
  .register-alt-card-header { margin-bottom: 8px; }
  .register-alt-field { margin-bottom: 5px; }
  .register-alt-btn { min-height: 47px; }
  .register-alt-divider-text { margin: 5px 0 3px; }
  .register-alt-btn-social { width: 44px; height: 44px; min-height: 44px; }
}

@media (max-width: 820px) {
  .legal-page-header, .legal-page-content { max-width: 97vw; padding-left: 6vw; padding-right: 6vw; }
}

@media (max-width: 520px) {
  .legal-page-title, .legal-page-header { font-size: 1.18rem; padding-top: 19px; }
  .legal-page-content { padding: 17px 6vw 18px; font-size: 0.97rem; }
}

@media (min-width: 901px) {
  .register-alt-page { padding: 0; }
  .register-alt-container { max-width: 1100px; min-height: 100vh; min-height: 100dvh; padding: 0; }
  .register-alt-brand { flex: 1; padding: 32px 40px; background: transparent; border: 0; border-radius: 0; gap: 12px; }
  .register-alt-crown { width: 130px; filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.5)); }
  .register-alt-divider { margin: 0; }
  .register-alt-brand-text { width: 280px; height: 110px; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
  .register-alt-brand-title { font-size: 2.2rem; margin: 0 0 8px; }
  .register-alt-tagline { height: 3.2em; margin: 0; padding: 0 12px; font-size: 0.82rem; line-height: 1.45; }
  .register-alt-card { max-width: 400px; padding: 18px 32px; border-radius: var(--radius-card); border-color: rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.03); box-shadow: none; }
  .register-alt-card-header { text-align: left; margin-bottom: 12px; }
  .register-alt-card-header h2 { font-size: 1.5rem; margin-bottom: 4px; }
  .register-alt-card-header p { font-size: 0.85rem; }
  .register-alt-field { margin-bottom: 8px; }
  .register-alt-field label { font-size: 0.68rem; margin-bottom: 4px; color: var(--color-text-subtle); }
  .register-alt-input-wrapper input { min-height: 34px; padding: 8px 40px 8px 44px; font-size: 0.82rem; border-radius: var(--radius-input); }
  .register-alt-terms-notice { margin: 6px 0 8px; }
  .register-alt-terms-notice p { font-size: 0.62rem; line-height: 1.25; }
  .register-alt-btn { min-height: 40px; padding: 8px; margin-top: 6px; font-size: 0.84rem; border-radius: var(--radius-button); }
  .register-alt-divider-text { margin: 10px 0 8px; }
  .register-alt-divider-text span { font-size: 0.6rem; }
  .register-alt-btn-social { min-height: 34px; padding: 8px; font-size: 0.76rem; border-radius: var(--radius-button); }
  .register-alt-login-text { margin-top: 10px; font-size: 0.74rem; }
  .register-alt-form-side { flex: 0 0 500px; padding: 24px; }
}

