/* Page: login.html — Authentication */

    /* ══════════════════════════════════════════
       LOGIN PAGE — inherits all global.css vars
       No overrides to existing design system
    ══════════════════════════════════════════ */

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      background: var(--off);
      font-family: var(--font-b);
      display: flex;
      flex-direction: column;
    }

    /* ── SPLIT LAYOUT ── */
    .login-wrap {
      flex: 1;
      display: grid;
      grid-template-columns: 1fr 1fr;
      min-height: 100vh;
    }

    /* ════════════════════════════
       LEFT PANEL — dark branding
    ════════════════════════════ */
    .login-left {
      background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%);
      display: flex;
      flex-direction: column;
      padding: 48px 52px;
      position: relative;
      overflow: hidden;
    }

    /* Dot grid overlay */
    .login-left::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image: radial-gradient(circle, rgba(255,255,255,.07) 1.5px, transparent 1.5px);
      background-size: 28px 28px;
      pointer-events: none;
    }

    /* Blue radial glow */
    .login-left::after {
      content: '';
      position: absolute;
      top: -120px; right: -80px;
      width: 500px; height: 500px;
      background: radial-gradient(circle, rgba(37,99,235,.22) 0%, transparent 68%);
      border-radius: 50%;
      pointer-events: none;
    }

    /* Bottom glow */
    .login-left__glow-b {
      position: absolute;
      bottom: -100px; left: -80px;
      width: 400px; height: 400px;
      background: radial-gradient(circle, rgba(109,40,217,.18) 0%, transparent 68%);
      border-radius: 50%;
      pointer-events: none;
    }

    /* ── Brand ── */
    .login-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      position: relative;
      z-index: 2;
      margin-bottom: auto;
    }
    .login-brand__mark {
      width: 36px; height: 36px;
      background: var(--blue);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px; font-weight: 800; color: #fff;
      box-shadow: 0 4px 16px rgba(37,99,235,.45);
    }
    .login-brand__name {
      font-size: 1.1rem; font-weight: 800;
      color: #fff; letter-spacing: -0.02em;
    }
    .login-brand__name em { font-style: normal; color: #b736e3; }

    /* ── Headline ── */
    .login-left__body {
      position: relative; z-index: 2;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 0 0 15px 0;
    }
    .login-left__eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(37,99,235,.18);
      border: 1px solid rgba(37,99,235,.3);
      border-radius: 20px;
      padding: 4px 14px;
      font-size: 11px; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      color: #93c5fd;
      margin-bottom: 24px;
      width: fit-content;
    }
    .login-left__eyebrow-dot {
      width: 6px; height: 6px;
      background: #60a5fa; border-radius: 50%;
      animation: blink 2.2s infinite;
    }
    @keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

    .login-left__headline {
      font-family: var(--font-d);
      font-size: clamp(2rem, 3.5vw, 3.2rem);
      font-weight: 700;
      color: #fff;
      line-height: 1.08;
      letter-spacing: -0.025em;
      margin-bottom: 20px;
    }
    .login-left__headline em {
      font-style: italic;
      color: #b736e3;
    }
    .login-left__sub {
      font-size: 15px;
      color: rgba(255,255,255,.55);
      line-height: 1.75;
      max-width: 450px;
      margin-bottom: 40px;
    }

    /* ── Trust stats ── */
    .login-stats {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 16px;
      margin-bottom: 0px;
    }
    .login-stat {
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.09);
      border-radius: 14px;
      padding: 16px;
      transition: background .2s;
    }
    .login-stat:hover { background: rgba(255,255,255,.08); }
    .login-stat__val {
      font-family: var(--font-d);
      font-size: 1.6rem; font-weight: 700;
      color: #fff; line-height: 1;
      letter-spacing: -0.02em;
    }
    .login-stat__val .accent { color: #60a5fa; }
    .login-stat__label {
      font-size: 11px;
      color: rgba(255,255,255,.38);
      margin-top: 5px;
      line-height: 1.4;
      font-weight: 600;
      letter-spacing: .03em;
    }

    /* ── Trust badges ── */
    .login-trust {
      display: flex;
      flex-direction: column;
      gap: 10px;
      position: relative;
      z-index: 2;
    }
    .login-trust-item {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 12px;
      font-weight: 600;
      color: rgba(255,255,255,.45);
    }
    .login-trust-item__icon {
      width: 28px; height: 28px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.1);
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; flex-shrink: 0;
    }

    /* ── Floating card ── */
    .login-float {
      position: absolute;
      bottom: 120px; right: -20px;
      background: rgba(255,255,255,.07);
      backdrop-filter: blur(12px);
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 16px;
      padding: 14px 18px;
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 2;
      animation: floatCard 5s ease-in-out infinite;
    }
    @keyframes floatCard { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
    .login-float__icon {
      width: 36px; height: 36px;
      background: rgba(37,99,235,.35);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px; flex-shrink: 0;
    }
    .login-float__val {
      font-size: 14px; font-weight: 700;
      color: #fff; line-height: 1.2;
    }
    .login-float__sub { font-size: 11px; color: rgba(255,255,255,.45); }

    /* ════════════════════════════
       RIGHT PANEL — form
    ════════════════════════════ */
    .login-right {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 30px 52px;
      background: var(--white);
      position: relative;
    }

    /* Subtle top accent bar */
    .login-right::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--blue), #60a5fa, var(--blue));
      background-size: 200% auto;
      animation: shimmer 3.5s linear infinite;
    }
    @keyframes shimmer { from{background-position:0%} to{background-position:200%} }

    .login-form-wrap {
      width: 100%;
      max-width: 400px;
    }

    /* ── Form header ── */
    .login-form-header {
          margin-bottom: 20px;
    margin-top: 15px;
    }
    .login-form-header__eyebrow {
      font-size: 11px; font-weight: 700;
      text-transform: uppercase; letter-spacing: .12em;
      color: var(--blue);
      margin-bottom: 10px;
    }
    .login-form-header__title {
      font-family: var(--font-d);
      font-size: clamp(1.7rem, 2.5vw, 2.2rem);
      font-weight: 700;
      color: var(--ink);
      letter-spacing: -0.025em;
      line-height: 1.1;
      margin-bottom: 10px;
    }
    .login-form-header__title em {
      font-style: italic; color: var(--blue);
    }
    .login-form-header__sub {
      font-size: 14px;
      color: var(--text-s);
      line-height: 1.65;
    }

    /* ── Form fields ── */
    .form-group {
      margin-bottom: 0px;
      position: relative;
    }
    .form-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 7px;
      letter-spacing: .01em;
    }
    .form-label a {
      font-weight: 600;
      color: var(--blue);
      text-decoration: none;
      font-size: 12px;
      transition: color .15s;
    }
    .form-label a:hover { color: var(--blue-light); text-decoration: underline; }

    .form-input-wrap {
      position: relative;
    }
    .form-input {
      width: 100%;
      height: 48px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 0 16px;
      font-family: var(--font-b);
      font-size: 14px;
      color: var(--ink);
      background: var(--white);
      outline: none;
      transition: border-color .2s, box-shadow .2s, background .2s;
      -webkit-appearance: none;
    }
    .form-input::placeholder { color: var(--text-m); }
    .form-input:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    }
    .form-input.has-icon { padding-left: 44px; }
    .form-input.has-action { padding-right: 48px; }

    /* Input icon */
    .input-icon {
      position: absolute;
      left: 14px; top: 50%;
      transform: translateY(-50%);
      color: var(--text-m);
      transition: color .2s;
      pointer-events: none;
      display: flex;
    }
    .form-input:focus ~ .input-icon,
    .form-input-wrap:focus-within .input-icon { color: var(--blue); }

    /* Password eye toggle */
    .input-action {
      position: absolute;
      right: 12px; top: 50%;
      transform: translateY(-50%);
      background: none; border: none;
      cursor: pointer;
      padding: 4px;
      color: var(--text-m);
      transition: color .15s;
      display: flex;
      border-radius: 6px;
    }
    .input-action:hover { color: var(--ink); }

    /* ── Field states ── */
    .form-input.is-error  { border-color: var(--fail); background: rgba(220,38,38,.025); }
    .form-input.is-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
    .form-input.is-success { border-color: var(--ok); }
    .form-input.is-success:focus { box-shadow: 0 0 0 3px rgba(22,163,74,.1); }

    /* ── Field validation tick/cross ── */
    .field-status {
      position: absolute;
      right: 14px; top: 50%;
      transform: translateY(-50%);
      width: 18px; height: 18px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      opacity: 0;
      transition: opacity .2s;
      pointer-events: none;
    }
    .field-status.ok   { background: var(--ok); opacity: 1; }
    .field-status.fail { background: var(--fail); opacity: 1; }
    /* When password action button present, shift tick left */
    .has-pw-toggle .field-status { right: 46px; }

    /* ── Inline error message ── */
    .field-error {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 12px;
      font-weight: 600;
      color: var(--fail);
      margin-top: 6px;
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      transform: translateY(-4px);
      transition: max-height .25s ease, opacity .2s ease .04s, transform .2s ease .04s;
    }
    .field-error.visible {
      max-height: 30px;
      opacity: 1;
      transform: translateY(0);
    }

    /* ── Remember me / options row ── */
    .form-options {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 22px;
      gap: 12px;
    }
    .form-check {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
    }
    .form-check__box {
      width: 18px; height: 18px;
      border: 1.5px solid var(--border);
      border-radius: 5px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: all .15s;
      background: var(--white);
    }
    .form-check input { display: none; }
    .form-check input:checked ~ .form-check__box {
      background: var(--blue);
      border-color: var(--blue);
    }
    .form-check__label {
      font-size: 13px;
      font-weight: 500;
      color: var(--text-s);
    }
    .form-forgot {
      font-size: 13px;
      font-weight: 600;
      color: var(--blue);
      text-decoration: none;
      transition: color .15s;
    }
    .form-forgot:hover { text-decoration: underline; }

    /* ── Submit button ── */
    .btn-submit {
      width: 100%;
      height: 50px;
      background: var(--blue);
      color: #fff;
      border: none;
      border-radius: 12px;
      font-family: var(--font-b);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: background .2s, transform .15s, box-shadow .2s;
      box-shadow: 0 4px 18px rgba(37,99,235,.3);
      position: relative;
      overflow: hidden;
      letter-spacing: .01em;
      margin-bottom: 20px;
    }
    .btn-submit:hover:not(:disabled) {
      background: #1d4ed8;
      transform: translateY(-1px);
      box-shadow: 0 8px 28px rgba(37,99,235,.4);
    }
    .btn-submit:active:not(:disabled) { transform: translateY(0); }
    .btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }

    /* Shimmer on hover */
    .btn-submit::after {
      content: '';
      position: absolute;
      top: 0; left: -100%;
      width: 60%; height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
      transform: skewX(-20deg);
      transition: left .5s;
    }
    .btn-submit:hover::after { left: 160%; }

    /* Loading spinner inside button */
    .btn-spinner {
      width: 18px; height: 18px;
      border: 2px solid rgba(255,255,255,.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite;
      display: none;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .btn-submit.loading .btn-text { display: none; }
    .btn-submit.loading .btn-spinner { display: block; }

    /* ── Divider ── */
    .form-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 18px;
      color: var(--text-m);
      font-size: 12px;
      font-weight: 600;
      letter-spacing: .04em;
    }
    .form-divider::before,
    .form-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    /* ── Social login buttons ── */
    .social-btns {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 28px;
    }
    .social-btn {
      height: 44px;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      background: var(--white);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-family: var(--font-b);
      font-size: 13px;
      font-weight: 600;
      color: var(--ink);
      cursor: pointer;
      transition: all .18s;
    }
    .social-btn:hover {
      border-color: var(--ink);
      background: var(--off);
    }
    .social-btn svg { flex-shrink: 0; }

    /* ── Sign up link ── */
    .form-signup {
      text-align: center;
      font-size: 13.5px;
      color: var(--text-s);
      padding-top: 20px;
      border-top: 1px solid var(--border);
    }
    .form-signup a {
      color: var(--blue);
      font-weight: 700;
      text-decoration: none;
      transition: color .15s;
    }
    .form-signup a:hover { text-decoration: underline; }

    /* ════════════════════════════
       TOAST NOTIFICATIONS
    ════════════════════════════ */
    .toast-stack {
      position: fixed;
      top: 20px; right: 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 9999;
      pointer-events: none;
    }
    .toast {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px 16px;
      box-shadow: 0 8px 32px rgba(15,23,42,.13);
      min-width: 300px;
      max-width: 380px;
      pointer-events: all;
      animation: toastIn .35s cubic-bezier(.2,.85,.4,1.2) both;
      position: relative;
      overflow: hidden;
    }
    @keyframes toastIn { from{transform:translateX(110%);opacity:0} to{transform:translateX(0);opacity:1} }
    .toast.toast-out { animation: toastOut .28s ease-in both; }
    @keyframes toastOut { to{transform:translateX(110%);opacity:0} }

    .toast__stripe {
      position: absolute;
      top: 0; left: 0; bottom: 0;
      width: 4px;
      border-radius: 4px 0 0 4px;
    }
    .toast.error   .toast__stripe { background: var(--fail); }
    .toast.success .toast__stripe { background: var(--ok); }
    .toast.info    .toast__stripe { background: var(--blue); }
    .toast.warn    .toast__stripe { background: var(--amber); }

    .toast__icon {
      width: 32px; height: 32px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; font-size: 15px;
    }
    .toast.error   .toast__icon { background: rgba(220,38,38,.1); }
    .toast.success .toast__icon { background: rgba(22,163,74,.1); }
    .toast.info    .toast__icon { background: rgba(37,99,235,.1); }
    .toast.warn    .toast__icon { background: rgba(217,119,6,.1); }

    .toast__body { flex: 1; min-width: 0; }
    .toast__title {
      font-size: 13px; font-weight: 700;
      color: var(--ink); margin-bottom: 2px;
    }
    .toast__msg { font-size: 12px; color: var(--text-s); line-height: 1.5; }

    .toast__close {
      width: 24px; height: 24px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 6px;
      color: var(--text-m);
      cursor: pointer;
      transition: all .15s;
      flex-shrink: 0; background: none; border: none;
    }
    .toast__close:hover { background: var(--off); color: var(--ink); }

    /* Progress bar on toast */
    .toast__progress {
      position: absolute;
      bottom: 0; left: 0;
      height: 2px;
      border-radius: 0 0 0 14px;
      animation: toastProgress linear forwards;
    }
    .toast.error   .toast__progress { background: var(--fail); }
    .toast.success .toast__progress { background: var(--ok); }
    .toast.info    .toast__progress { background: var(--blue); }
    .toast.warn    .toast__progress { background: var(--amber); }
    @keyframes toastProgress { from{width:100%} to{width:0%} }

    /* ════════════════════════════
       FORGOT PASSWORD MODAL
    ════════════════════════════ */
    .modal-backdrop {
      position: fixed; inset: 0;
      background: rgba(15,23,42,.5);
      z-index: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      opacity: 0; pointer-events: none;
      transition: opacity .25s;
      backdrop-filter: blur(4px);
    }
    .modal-backdrop.open {
      opacity: 1; pointer-events: all;
    }
    .modal {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 22px;
      padding: 36px;
      width: 100%;
      max-width: 420px;
      box-shadow: 0 24px 80px rgba(15,23,42,.2);
      transform: scale(.92) translateY(20px);
      transition: transform .3s cubic-bezier(.2,.85,.4,1.1);
      position: relative;
    }
    .modal-backdrop.open .modal {
      transform: scale(1) translateY(0);
    }
    .modal__close {
      position: absolute;
      top: 16px; right: 16px;
      width: 30px; height: 30px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      background: var(--off); border: 1px solid var(--border);
      cursor: pointer; color: var(--text-s);
      transition: all .15s;
    }
    .modal__close:hover { background: var(--border); color: var(--ink); }
    .modal__icon {
      width: 52px; height: 52px;
      background: var(--blue-pale);
      border-radius: 14px;
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; margin-bottom: 18px;
    }
    .modal__title {
      font-family: var(--font-d);
      font-size: 1.5rem; font-weight: 700;
      color: var(--ink); letter-spacing: -0.02em;
      margin-bottom: 8px;
    }
    .modal__sub {
      font-size: 13.5px; color: var(--text-s);
      line-height: 1.65; margin-bottom: 26px;
    }
    .modal__sub strong { color: var(--ink); }
    .modal__btn {
      width: 100%;
      height: 48px;
      background: var(--blue);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-family: var(--font-b);
      font-size: 14px; font-weight: 700;
      cursor: pointer;
      transition: background .2s, transform .15s;
      margin-top: 8px;
      box-shadow: 0 4px 16px rgba(37,99,235,.28);
    }
    .modal__btn:hover { background: #1d4ed8; transform: translateY(-1px); }
    .modal__back {
      display: block;
      text-align: center;
      margin-top: 14px;
      font-size: 13px;
      color: var(--text-m);
      cursor: pointer;
      text-decoration: none;
      transition: color .15s;
    }
    .modal__back:hover { color: var(--ink); }

    /* Success state inside modal */
    .modal__success {
      text-align: center;
      display: none;
    }
    .modal__success.visible { display: block; }
    .modal__success-icon {
      width: 60px; height: 60px;
      background: rgba(22,163,74,.1);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 26px; margin: 0 auto 18px;
      animation: popIn .4s cubic-bezier(.2,.85,.4,1.3) both;
    }
    @keyframes popIn { from{transform:scale(0)} to{transform:scale(1)} }

    .modal__form { transition: opacity .2s; }
    .modal__form.hidden { opacity: 0; pointer-events: none; height: 0; overflow: hidden; }

    /* ════════════════════════════
       RESPONSIVE
    ════════════════════════════ */
    @media(max-width: 900px) {
      .login-wrap { grid-template-columns: 1fr; }
      .login-left { display: none; }
      .login-right {
        padding: 40px 28px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 60px;
      }
      .login-form-wrap { max-width: 100%; }
    }
    @media(max-width: 480px) {
      .login-right { padding: 40px 20px; }
      .social-btns { grid-template-columns: 1fr; }
    }

    /* ── Animations ── */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(16px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .fade-up { animation: fadeUp .5s var(--ease, cubic-bezier(.4,0,.2,1)) both; }
    .fade-up--1 { animation-delay: .08s; }
    .fade-up--2 { animation-delay: .16s; }
    .fade-up--3 { animation-delay: .24s; }
    .fade-up--4 { animation-delay: .32s; }
    .fade-up--5 { animation-delay: .40s; }
