*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

      :root {
         --accent:        #0071e3;
         --accent-hover:  #005bb5;
         --accent-ring:   rgba(0,113,227,0.18);

         --text-primary:   #111318;
         --text-secondary: #4b5563;
         --text-muted:     #9ca3af;

         --border:        #e5e7eb;
         --bg:            #f9fafb;
         --card:          #ffffff;

         --radius-card:   16px;
         --radius-input:  10px;
         --radius-btn:    10px;
         --radius-pill:   999px;

         --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.07);
         --transition:  0.15s ease;
         --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      }

      html, body {
         min-height: 100%;
         font-family: var(--font);
         background: var(--bg);
         color: var(--text-primary);
         -webkit-font-smoothing: antialiased;
      }

      /* subtle dot-grid background */
      body {
         background-color: #f9fafb;
         background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
         background-size: 24px 24px;
      }

      /* ── NAV ── */
/* BEFORE — targets every <header> on the page */
header {
   position: fixed;
   top: 0; left: 0; right: 0;
   z-index: 100;
   display: flex;
   align-items: center;
   background: rgba(255,255,255,0.80);
   backdrop-filter: saturate(180%) blur(16px);
   -webkit-backdrop-filter: saturate(180%) blur(16px);
   border-bottom: 1px solid var(--border);
}

/* AFTER — only targets the navbar */
#app-nav {
   position: fixed;
   top: 0; left: 0; right: 0;
   z-index: 100;
   display: flex;
   align-items: center;
   background: rgba(255,255,255,0.80);
   backdrop-filter: saturate(180%) blur(16px);
   -webkit-backdrop-filter: saturate(180%) blur(16px);
   border-bottom: 1px solid var(--border);
}

      .nav-inner {
         max-width: 1080px;
         margin: 0 auto;
         padding: 12px 24px;
         width: 100%;
         display: flex;
         align-items: center;
         justify-content: space-between;
      }

      .nav-logo {
         display: flex;
         align-items: center;
         gap: 8px;
         text-decoration: none;
      }

      .nav-logo img { width: 30px; height: 30px; border-radius: 7px; }

      .nav-logo span {
         font-size: 0.9375rem;
         font-weight: 600;
         color: var(--text-primary);
         letter-spacing: -0.02em;
      }

      .nav-logo span em { color: var(--accent); font-style: normal; }

      .nav-links {
         display: flex;
         align-items: center;
         gap: 0;
         list-style: none;
      }

      .nav-links a {
         padding: 6px 13px;
         font-size: 0.8125rem;
         font-weight: 400;
         color: var(--text-secondary);
         text-decoration: none;
         border-radius: 7px;
         transition: color var(--transition), background var(--transition);
         display: flex;
         align-items: center;
         gap: 5px;
      }

      .nav-links a:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
      .nav-links a .fa { font-size: 0.75rem; }

      /* mobile nav */
      .nav-toggle {
         display: none;
         flex-direction: column;
         align-items: center;
         background: none;
         border: none;
         cursor: pointer;
         padding: 6px;
         gap: 0;
      }

      .nav-toggle-bars { display: flex; flex-direction: column; gap: 4px; }

      .nav-toggle span {
         display: block;
         width: 20px;
         height: 1.5px;
         background: var(--text-primary);
         border-radius: 2px;
      }

      .nav-toggle-label {
         font-size: 0.55rem;
         font-weight: 600;
         color: var(--accent);
         letter-spacing: 0.07em;
         margin-top: 3px;
      }

      @media (max-width: 600px) {
         .nav-toggle { display: flex; }
         .nav-links {
            display: none;
            position: fixed;
            top: 56px;
            left: 0; right: 0;
            background: rgba(255,255,255,0.98);
            backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border);
            flex-direction: column;
            align-items: center;
            padding: 10px 16px 16px;
            gap: 2px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.08);
            z-index: 99;
         }
         .nav-links.open { display: flex; }
         .nav-links a {
            width: 180px;
            justify-content: center;
            font-size: 0.9375rem;
            padding: 10px 16px;
         }
      }

      /* ── PAGE ── */
      .page {
         min-height: 100vh;
         padding-top: 56px;
         display: flex;
         flex-direction: column;
         align-items: center;
         justify-content: center;
         padding-bottom: 48px;
         gap: 0;
      }

      /* ── BRAND HEADER ── */
      .brand-header {
         display: flex;
         flex-direction: column;
         align-items: center;
         gap: 10px;
         margin-bottom: 24px;
         animation: fadeUp 0.4s ease both;
      }

      .brand-header img {
         width: 56px;
         height: 56px;
         border-radius: 14px;
         box-shadow: 0 2px 12px rgba(0,0,0,0.12);
      }

      .brand-header h1 {
         font-size: 1.375rem;
         font-weight: 600;
         letter-spacing: -0.03em;
         color: var(--text-primary);
         line-height: 1.2;
      }

      .brand-header p {
         font-size: 0.875rem;
         color: var(--text-muted);
         letter-spacing: -0.01em;
         font-weight: 400;
      }

      /* ── PROMO BANNER ── */
      .promo-banner {
         margin-bottom: 18px;
         background: var(--accent);
         color: #fff;
         text-align: center;
         padding: 9px 18px;
         border-radius: var(--radius-pill);
         font-size: 0.8rem;
         font-weight: 500;
         letter-spacing: -0.01em;
         animation: fadeUp 0.4s ease both 0.05s;
      }

      .promo-banner a {
         color: #fff;
         background: rgba(255,255,255,0.22);
         padding: 2px 10px;
         border-radius: var(--radius-pill);
         text-decoration: none;
         margin-left: 7px;
         font-weight: 600;
         font-size: 0.75rem;
         transition: background var(--transition);
         white-space: nowrap;
      }

      .promo-banner a:hover { background: rgba(255,255,255,0.38); }

      /* ── CARD ── */
      /* FIX: removed overflow:hidden — it was clipping the input right border.
         .card-footer handles its own bottom border-radius instead. */
      .card {
         width: 100%;
         max-width: 384px;
         background: var(--card);
         border-radius: var(--radius-card);
         border: 1px solid var(--border);
         box-shadow: var(--shadow-card);
         animation: fadeUp 0.4s ease both 0.08s;
      }

      @keyframes fadeUp {
         from { opacity: 0; transform: translateY(12px); }
         to   { opacity: 1; transform: translateY(0); }
      }

      /* ── STATUS MSG ── */
      .status-msg {
         display: none;
         margin: 16px 20px 0;
         padding: 11px 14px;
         border-radius: 8px;
         font-size: 0.8125rem;
         font-weight: 500;
         background: #fffbeb;
         color: #78350f;
         border: 1px solid #fde68a;
      }

      .status-msg.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
      .status-msg.success { background: #f0fdf4; color: #14532d; border-color: #bbf7d0; }

      /* ── TAB PILL SWITCHER ── */
      .tabs {
         padding: 16px 16px 0;
      }

      .tab-switcher {
         display: flex;
         background: var(--bg);
         border-radius: 9px;
         padding: 3px;
         gap: 3px;
      }

      .tab-btn {
         flex: 1;
         background: none;
         border: none;
         padding: 8px 0;
         font-family: var(--font);
         font-size: 0.875rem;
         font-weight: 500;
         color: var(--text-muted);
         cursor: pointer;
         border-radius: 7px;
         transition: background var(--transition), color var(--transition), box-shadow var(--transition);
         letter-spacing: -0.01em;
      }

      .tab-btn.active {
         background: #fff;
         color: var(--text-primary);
         box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
      }

      /* ── FORM BODY ── */
      .form-body { padding: 20px; }

      .form-pane { display: none; }
      .form-pane.active {
         display: block;
         animation: fadeUp 0.2s ease both;
      }

      /* ── FIELD WRAPPER ── */
      .field {
         margin-bottom: 10px;
         position: relative;
         width: 100%;
      }

      .field-icon {
         position: absolute;
         left: 13px;
         top: 50%;
         transform: translateY(-50%);
         color: var(--text-muted);
         font-size: 0.8rem;
         z-index: 2;
         pointer-events: none;
      }

      /* FIX: default right padding is normal (14px).
         Only password fields with a toggle icon get extra right room. */
      .field input {
         width: 100%;
         height: 44px;
         padding: 0 14px 0 38px;
         border: 1px solid var(--border);
         border-radius: var(--radius-input);
         font-family: var(--font);
         font-size: 0.9375rem;
         color: var(--text-primary);
         background: var(--bg);
         outline: none;
         transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
         letter-spacing: -0.01em;
      }

      /* fields without a left icon get normal left padding */
      .field.no-icon input { padding-left: 14px; }

      /* fields with a right-side toggle (e.g. password show/hide) */
      .field.has-toggle input { padding-right: 40px; }

      .field input::placeholder { color: var(--text-muted); }

      .field input:focus {
         background: #fff;
         border-color: var(--accent);
         box-shadow: 0 0 0 3px var(--accent-ring);
      }

      .field .toggle-password {
         position: absolute;
         right: 12px;
         top: 50%;
         transform: translateY(-50%);
         color: var(--text-muted);
         cursor: pointer;
         font-size: 0.8rem;
         z-index: 2;
         transition: color var(--transition);
      }

      .field .toggle-password:hover { color: var(--text-secondary); }

      /* password strength hint */
      .field[data-tip] .field-tip {
         display: none;
         position: absolute;
         top: calc(100% + 5px);
         left: 0; right: 0;
         background: #111318;
         color: #f9fafb;
         font-size: 0.74rem;
         padding: 8px 11px;
         border-radius: 7px;
         z-index: 20;
         line-height: 1.5;
         pointer-events: none;
      }

      .field[data-tip]:focus-within .field-tip { display: block; }

      /* ── DIVIDER ── */
      .divider {
         display: flex;
         align-items: center;
         gap: 10px;
         margin: 14px 0;
      }

      .divider::before,
      .divider::after {
         content: '';
         flex: 1;
         height: 1px;
         background: var(--border);
      }

      .divider span {
         font-size: 0.75rem;
         color: var(--text-muted);
         white-space: nowrap;
      }

      /* ── META ROW ── */
      .row-meta {
         display: flex;
         align-items: center;
         justify-content: space-between;
         margin: 8px 0 14px;
         font-size: 0.8125rem;
      }

      .row-meta label {
         display: flex;
         align-items: center;
         gap: 7px;
         color: var(--text-secondary);
         cursor: pointer;
         user-select: none;
      }

      .row-meta input[type="checkbox"] {
         width: 14px;
         height: 14px;
         accent-color: var(--accent);
         cursor: pointer;
         flex-shrink: 0;
      }

      .row-meta a {
         color: var(--accent);
         text-decoration: none;
         font-weight: 500;
         font-size: 0.8125rem;
      }

      .row-meta a:hover { text-decoration: underline; }

      /* ── PRIMARY BUTTON ── */
      .btn-primary {
         width: 100%;
         height: 44px;
         background: var(--accent);
         color: #fff;
         border: none;
         border-radius: var(--radius-btn);
         font-family: var(--font);
         font-size: 0.9375rem;
         font-weight: 500;
         letter-spacing: -0.01em;
         cursor: pointer;
         transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
      }

      .btn-primary:hover {
         background: var(--accent-hover);
         box-shadow: 0 4px 12px rgba(0,113,227,0.28);
      }

      .btn-primary:active { transform: scale(0.99); }

      /* ── TERMS ── */
      .terms-line {
         text-align: center;
         font-size: 0.75rem;
         color: var(--text-muted);
         margin: 4px 0 12px;
         line-height: 1.55;
      }

      .terms-line a { color: var(--text-secondary); font-weight: 500; text-decoration: underline; }

      /* ── SUCCESS PANE ── */
      .success-pane {
         display: none;
         text-align: center;
         padding: 32px 20px;
      }

      .success-pane .icon {
         width: 52px;
         height: 52px;
         background: #f0fdf4;
         border-radius: 50%;
         display: flex;
         align-items: center;
         justify-content: center;
         margin: 0 auto 14px;
         font-size: 1.35rem;
      }

      .success-pane p {
         font-size: 0.9375rem;
         color: var(--text-secondary);
         line-height: 1.6;
         margin-bottom: 18px;
      }

      .success-pane a {
         color: var(--accent);
         font-weight: 500;
         text-decoration: none;
      }

      /* ── CARD FOOTER ── */
      /* FIX: border-radius on bottom corners replaces the old overflow:hidden on .card */
      .card-footer {
         border-top: 1px solid var(--border);
         padding: 12px 20px;
         text-align: center;
         font-size: 0.72rem;
         color: var(--text-muted);
         line-height: 1.7;
         background: var(--bg);
         border-radius: 0 0 var(--radius-card) var(--radius-card);
      }

      .card-footer a { color: var(--text-muted); text-decoration: none; }
      .card-footer a:hover { color: var(--text-secondary); text-decoration: underline; }
      .card-footer .sep { margin: 0 5px; }

      /* ── PAGE FOOTER ── */
      .page-footer {
         margin-top: 20px;
         text-align: center;
         font-size: 0.72rem;
         color: var(--text-muted);
         animation: fadeUp 0.4s ease both 0.15s;
      }