/* ---------- AUTH PAGES (signup / login) ---------- */

  /* dashboard.css locks body overflow for the app shell pages, which
     use their own internal scroll areas. auth pages don't have that
     structure, so that rule needs to be undone here or the page traps
     you with no way to scroll past the fold. */
     body{
      height: auto;
      min-height: 100vh;
      overflow-y: auto;
      position: relative;
    }
  
    /* a fragment of a node network sitting behind the auth card, same
       motif as the logo, applied as ambient texture rather than a
       generic dot grid. deliberately sparse and low-contrast so it
       reads as texture, not decoration competing with the form. */
    body::before{
      content: "";
      position: fixed;
      inset: 0;
      background-image:
        radial-gradient(circle at 12% 18%, var(--accent) 0, transparent 0.9%),
        radial-gradient(circle at 85% 12%, var(--accent) 0, transparent 0.9%),
        radial-gradient(circle at 90% 78%, var(--accent) 0, transparent 0.9%),
        radial-gradient(circle at 8% 82%, var(--accent) 0, transparent 0.9%),
        radial-gradient(circle at 50% 92%, var(--accent) 0, transparent 0.9%);
      opacity: 0.35;
      pointer-events: none;
      z-index: 0;
    }
  
    .auth-page{
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 20px;
    }
  
    .auth-box{
      width: 100%;
      max-width: 440px;
    }
  
    .auth-logo{
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin-bottom: 28px;
      font-family: var(--mono);
      font-weight: 700;
      font-size: 16px;
      text-decoration: none;
      color: var(--text);
    }
  
    .auth-logo .logo-badge{
      width: 32px;
      height: 32px;
      border-radius: var(--radius-sm);
      background: linear-gradient(155deg, var(--surface2) 0%, var(--surface) 100%);
      border: 1px solid var(--border);
      color: var(--accent);
      box-shadow: var(--shadow-sm);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .auth-logo .logo-badge svg{ width: 16px; height: 16px; }

    .auth-card{
      background: linear-gradient(165deg, var(--surface2) 0%, var(--surface) 45%);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      padding: 32px;
    }
  
    .auth-title{
      font-size: 22px;
      font-weight: 700;
      margin-bottom: 6px;
      text-align: center;
    }
  
    .auth-sub{
      color: var(--muted);
      font-size: 13px;
      text-align: center;
      margin-bottom: 28px;
    }
  
    .auth-field{
      margin-bottom: 16px;
    }
  
    .auth-field label{
      display: block;
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 7px;
      font-family: var(--sans);
    }
  
    .auth-field input{
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      font-family: var(--sans);
      font-size: 14px;
      outline: none;
      transition: border-color 0.15s, box-shadow 0.2s var(--ease);
    }

    .auth-field input:focus{
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
    }
  
    .auth-field-hint{
      font-size: 11px;
      color: var(--muted);
      margin-top: 5px;
    }

    /* the Terms and Privacy links under Sign up fell back to the
       browser's dark blue, which barely shows on the dark card */
    .auth-field-hint a{ color: var(--accent-2); text-decoration: none; font-weight: 600; }
    .auth-field-hint a:hover{ text-decoration: underline; }
  
    /* ---------- PASSWORD STRENGTH CHECKLIST ---------- */
    /* hidden by default, reveals when the password field is focused,
       collapses back down once every requirement is met and the field
       loses focus, same grid-rows expand trick used elsewhere in the
       app for smooth height animation without a fixed max-height guess */
  
    .pw-checklist{
      display: grid;
      grid-template-rows: 0fr;
      overflow: hidden;
      transition: grid-template-rows 0.22s ease;
      margin-top: 0;
    }
  
    .pw-checklist.open{
      grid-template-rows: 1fr;
    }
  
    .pw-checklist-inner{
      min-height: 0;
      overflow: hidden;
    }
  
    .pw-checklist-list{
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding-top: 10px;
    }
  
    .pw-check-item{
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: var(--mono);
      font-size: 11px;
      color: var(--muted);
      transition: color 0.15s ease;
    }
  
    .pw-check-item.met{ color: var(--ok); }
  
    .pw-check-icon{
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      border-radius: 50%;
      border: 1.4px solid var(--border);
      position: relative;
      transition: border-color 0.15s ease, background 0.15s ease;
    }
  
    .pw-check-item.met .pw-check-icon{
      border-color: var(--ok);
      background: var(--ok);
    }
  
    .pw-check-icon svg{
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      color: var(--bg);
      opacity: 0;
      transform: scale(0.4);
      transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
  
    .pw-check-item.met .pw-check-icon svg{
      opacity: 1;
      transform: scale(1);
    }
  
    /* track-picker styles now live in the shared dashboard.css, since
       Settings (which doesn't load auth.css) needs them too */
  
    .auth-submit{
      width: 100%;
      padding: 11px;
      font-size: 14px;
      margin-top: 6px;
    }
  
    .auth-footer-link{
      text-align: center;
      margin-top: 20px;
      font-size: 13px;
      color: var(--muted);
    }
  
    .auth-footer-link a{
      color: var(--accent);
      text-decoration: none;
    }
  
    .auth-footer-link a:hover{ text-decoration: underline; }
  
    .auth-error{
      background: rgba(229,72,77,0.08);
      border: 1px solid var(--danger);
      color: var(--danger);
      font-size: 13px;
      padding: 10px 12px;
      border-radius: 8px;
      margin-bottom: 16px;
      display: none;
    }
  
    .auth-error.show{ display: block; }

    /* ---------- OTP / VERIFICATION CODE INPUT (shared: check-email +
       reset-password) ---------- */

    .otp-input{
      text-align: center;
      letter-spacing: 6px;
      font-family: var(--mono);
      font-size: 20px;
    }

    /* ---------- DECORATIVE HEADING ICON (check-email) ---------- */
    /* a plain-line icon in the app's own accent-badge style, not a
       platform emoji: an emoji renders in whatever colorful style the
       OS/browser ships and reads inconsistent against an otherwise
       monochrome-plus-accent interface. */

    .auth-icon-badge{
      width: 52px;
      height: 52px;
      margin: 0 auto 18px;
      border-radius: var(--radius-md);
      background: linear-gradient(155deg, var(--surface2) 0%, var(--surface) 100%);
      border: 1px solid var(--border);
      color: var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-sm);
    }

    .auth-icon-badge svg{ width: 24px; height: 24px; }

    /* ---------- SECONDARY SUBMIT (e.g. "Resend code") ---------- */

    .auth-submit-secondary{
      margin-top: 10px;
    }

    /* ---------- LIVE PASSWORD-MATCH HINT ---------- */

    .auth-field-hint.match{ color: var(--ok); }
    .auth-field-hint.mismatch{ color: var(--danger); }

    /* ---------- RESPONSIVE ---------- */

    @media (max-width: 420px){
      .auth-page{ padding: 28px 14px; }
      .auth-card{ padding: 22px 18px; }
    }