/* =============================================================
 *  screens/auth.css
 *  Extraído automaticamente de index.php.
 *  NÃO editar manualmente até remover o script de split.
 * ============================================================= */

    /* ── AUTH ── */
    #auth-screen {
      min-height: 100dvh;
      display: flex; align-items: center; justify-content: center;
      padding: 24px 16px;
      background: linear-gradient(145deg, #daf2ea 0%, #eef8f4 45%, #e8f0fb 100%);
    }

    .auth-card {
      background: var(--panel);
      border-radius: 20px;
      padding: 40px 36px;
      width: min(420px, 100%);
      max-height: calc(100dvh - 48px);
      overflow: auto;
      overscroll-behavior: contain;
      box-shadow: var(--sh-lg), 0 0 0 1px var(--border);
      animation: fadeUp .4s ease;
    }

    @media (max-height: 720px) {
      #auth-screen { padding: 16px 12px; }
      .auth-card { padding: 28px 22px; }
    }

    /* Em ecrãs grandes, o cadastro pode usar mais espaço. */
    @media (min-width: 720px) and (min-height: 720px) {
      #auth-screen .auth-card.mode-register {
        width: min(760px, 100%);
        max-height: none;
        overflow: visible;
      }
    }

    .auth-formgrid { display: block; }

    /* Cadastro: usar 2 colunas “de verdade” em telas grandes */
    @media (min-width: 720px) {
      .auth-card.mode-register .auth-formgrid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
        row-gap: 14px;
        align-items: start;
      }
      .auth-card.mode-register .auth-formgrid > .field-group { margin-bottom: 0; }
      .auth-card.mode-register .auth-formgrid > .span-2 { grid-column: 1 / -1; }
    }

    /* Logo: ícone primeiro, depois texto */
    .auth-logo-icon { order: 0; }
    .auth-logo-text { order: 1; }

    /* Cadastro: coluna “meta” do usuário ao lado do campo */
    @media (min-width: 720px) {
      .auth-card.mode-register #grp-username { grid-column: 1 / 2; }
      .auth-card.mode-register #grp-username-meta { grid-column: 2 / 3; }
      .auth-card.mode-register #grp-username { grid-row: auto; }
      .auth-card.mode-register #grp-username-meta { padding-top: 22px; }
      .auth-card.mode-register #grp-username-meta .field-hint { margin-top: 0; }
      .auth-card.mode-register #grp-username-meta .field-name-status { margin-top: 8px; }
    }

    /* Linha de senha (cadastro): 3 colunas (senha, confirmar, botão) */
    .auth-pass-row { display: block; }
    @media (min-width: 720px) {
      .auth-card.mode-register .auth-pass-row {
        display: grid;
        grid-template-columns: 1fr 1fr minmax(180px, 240px);
        column-gap: 16px;
        row-gap: 14px;
        align-items: end;
      }
      .auth-card.mode-register .auth-pass-row > .field-group { margin-bottom: 0; }
      .auth-card.mode-register .auth-pass-row > #auth-btn { height: 46px; }
      .auth-card.mode-register .auth-pass-row > #auth-btn { margin-top: 0; }
    }

    .auth-brand { margin-bottom: 16px; }
    .auth-logo { display: flex; align-items: center; gap: 12px; }
    .auth-logo-icon {
      width: 48px; height: 48px; border-radius: 14px;
      background: transparent;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 4px 14px var(--accent-glow);
      flex-shrink: 0;
      overflow: hidden;
    }
    /* Ampliação leve para a squircle verde tapar cantos transparentes do PNG dentro do mesmo quadrado */
    .auth-logo-icon img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: 50% 50%;
      transform: scale(1.2);
      transform-origin: 50% 50%;
      border-radius: 0;
    }
    .auth-logo-text { font-size: 19px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
    .auth-logo-text span { color: var(--accent); }
    .auth-tagline {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin: 12px 0 0;
      font-size: 12px;
      font-weight: 700;
      color: var(--text-2);
    }
    .auth-tagline::before,
    .auth-tagline::after {
      content: '';
      flex: 0 0 26px;
      height: 2px;
      border-radius: 1px;
      background: var(--accent);
      opacity: 0.85;
    }

    .auth-subtitle {
      font-size: 14px; font-weight: 700; color: var(--text-2);
      margin: 0 0 22px; line-height: 1.45;
    }

    .field-group { margin-bottom: 14px; }
    .field-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
    .field-input {
      width: 100%; background: var(--surface); border: 1.5px solid var(--border);
      border-radius: var(--radius-sm); padding: 12px 14px;
      font-size: 16px; color: var(--text); outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
    .field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--panel); }
    .field-input::placeholder { color: var(--text-3); }
    .field-input[aria-invalid="true"] { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }

    .field-with-icon {
      position: relative;
      display: block;
    }
    .field-input-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-3);
      opacity: 0.7;
      pointer-events: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .field-input-icon svg { display: block; flex-shrink: 0; }
    .field-input--with-leading-icon {
      padding-left: 42px;
    }
    .field-with-icon:focus-within .field-input-icon,
    .field-pass-wrap:focus-within .field-input-icon {
      color: var(--accent);
      opacity: 1;
    }

    .field-hint {
      font-size: 12px; font-weight: 600; color: var(--text-3);
      margin: 6px 0 0; line-height: 1.4;
    }
    .field-name-status {
      font-size: 12px; font-weight: 700; margin: 6px 0 0; min-height: 1.2em;
    }
    .field-name-status.ok { color: var(--green); }
    .field-name-status.bad { color: #b91c1c; }

    .name-suggestions {
      display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
    }
    .name-suggestions button {
      border: 1px solid var(--border); background: var(--surface);
      color: var(--accent); font-size: 12px; font-weight: 800;
      padding: 6px 10px; border-radius: 999px; cursor: pointer;
    }
    .name-suggestions button:hover { background: var(--accent-soft); border-color: #c7d2fe; }
    .name-suggestions button:focus-visible {
      outline: 2px solid var(--accent); outline-offset: 2px;
    }

    .field-pass-wrap {
      position: relative;
      display: block;
    }
    .field-pass-wrap .field-pass-inp {
      width: 100%;
      box-sizing: border-box;
      padding-right: 42px;
    }
    .btn-pass-toggle-icon {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      width: 32px;
      height: 32px;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--text-3);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.55;
      transition: opacity .15s, color .15s, background .15s;
    }
    .btn-pass-toggle-icon:hover {
      opacity: 1;
      color: var(--accent);
      background: var(--accent-soft);
    }
    .btn-pass-toggle-icon:focus-visible {
      outline: 2px solid var(--accent); outline-offset: 1px;
    }
    .btn-pass-toggle-icon svg { display: block; flex-shrink: 0; }

    .auth-footer-links {
      margin-top: 16px; text-align: center; font-size: 14px; font-weight: 700;
    }
    .auth-link {
      background: none; border: none; padding: 0; margin: 0;
      color: var(--accent); font: inherit; font-weight: 800;
      cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
    }
    .auth-link:focus-visible {
      outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
    }

    .auth-modal-overlay {
      position: fixed; inset: 0; z-index: 20000;
      background: rgba(15, 23, 42, .45);
      display: flex; align-items: center; justify-content: center;
      padding: 20px 16px;
    }
    .auth-modal-card {
      background: var(--panel); border-radius: 20px; padding: 28px 24px;
      width: min(400px, 100%);
      box-shadow: var(--sh-lg), 0 0 0 1px var(--border);
    }
    .auth-modal-title { font-size: 18px; font-weight: 900; margin: 0 0 12px; color: var(--text); }
    .auth-modal-body { font-size: 14px; font-weight: 600; color: var(--text-2); line-height: 1.5; margin: 0 0 20px; }
    .auth-modal-forgot-hint { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 14px; line-height: 1.45; }
    .auth-modal-error { margin: 12px 0; display: none; }
    .auth-modal-error.show { display: block; }
    .auth-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
    .auth-modal-actions--stack {
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
    }
    .auth-modal-actions--stack .btn-primary,
    .auth-modal-actions--stack .btn-secondary { width: 100%; }
    .auth-modal-card > .btn-primary { width: 100%; margin-top: 4px; }
    .btn-secondary {
      padding: 11px 16px; border-radius: var(--radius-sm);
      border: 1.5px solid var(--border); background: var(--surface);
      color: var(--text-2); font-size: 14px; font-weight: 800; cursor: pointer;
    }
    .btn-secondary:hover { background: var(--panel); border-color: var(--text-3); color: var(--text); }
    .btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

    .auth-error {
      background: var(--red-soft); border: 1px solid #fca5a5; border-radius: var(--radius-xs);
      padding: 10px 14px; font-size: 13px; font-weight: 600; color: #b91c1c;
      margin-bottom: 16px; display: none; animation: fadeUp .2s ease;
    }
    .auth-error.show { display: block; }
    .auth-offline-hint {
      font-size: 12px; font-weight: 600; color: var(--text-2);
      margin: -2px 0 14px; line-height: 1.45; text-align: center;
    }

    .btn-primary {
      width: 100%; padding: 13px; background: var(--accent); color: #fff;
      border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 800;
      cursor: pointer; letter-spacing: .01em; margin-top: 4px;
      transition: background .2s, box-shadow .2s, transform .1s;
    }
    .btn-primary:hover  { background: var(--accent-h); box-shadow: 0 4px 16px var(--accent-glow); }
    .btn-primary:active { transform: scale(.98); }
    .btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
    .btn-primary:focus-visible {
      outline: 2px solid var(--accent-h);
      outline-offset: 3px;
    }


    .auth-version {
      margin-top: 18px; text-align: center; font-size: 11px; font-weight: 600;
      color: var(--text-3); letter-spacing: .02em;
    }
