/* ── Reset & base ─────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; height: 100%; }
    body {
      font-family: 'IBM Plex Sans', system-ui, sans-serif;
      font-size: 14px;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      background: #F4F6F8;
      color: #15181D;
      min-height: 100vh;
    }
    a { color: inherit; text-decoration: none; }
    button, input, select { font-family: inherit; }

    /* ── Theme-aware CSS vars ─────────────────────────────────── */
    :root {
      --red:       #D7282F;
      --red-deep:  #9A1620;
      --red-deep2: #7E121B;
      --red-dark:  #5E0D14;
      --red-soft:  #FBEAEB;
      --surface:   #fff;
      --border:    #E6E9EE;
      --text:      #15181D;
      --text-2:    #3A4150;
      --text-3:    #6B7280;
      --text-4:    #98A1AE;
      --bg:        #F4F6F8;
      --shadow-md: 0 8px 32px -8px rgba(16,24,40,.16);
      --shadow-lg: 0 20px 60px -12px rgba(16,24,40,.22);
      --radius:    12px;
      --radius-lg: 18px;
    }
    [data-theme="dark"] {
      --surface: #171A20;
      --border:  #2A2F38;
      --text:    #F2F4F7;
      --text-2:  #CDD3DC;
      --text-3:  #9AA3AF;
      --text-4:  #6E7782;
      --bg:      #0E1014;
      --red-soft:#2E1719;
      --shadow-md: 0 8px 32px -8px rgba(0,0,0,.5);
      --shadow-lg: 0 20px 60px -12px rgba(0,0,0,.65);
    }

    /* ── Page layout — two-column split ──────────────────────── */
    .login-page {
      min-height: 100vh;
      display: flex;
    }

    /* LEFT — Brand panel */
    .brand-panel {
      flex: 0 0 46%;
      background: linear-gradient(155deg, #9A1620 0%, #7E121B 55%, #4A0A0F 100%);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 48px 52px;
      color: #fff;
    }

    /* decorative circles */
    .brand-panel::before {
      content: '';
      position: absolute;
      width: 520px; height: 520px;
      border-radius: 50%;
      border: 1.5px solid rgba(255,255,255,.07);
      top: -140px; right: -180px;
      pointer-events: none;
    }
    .brand-panel::after {
      content: '';
      position: absolute;
      width: 340px; height: 340px;
      border-radius: 50%;
      border: 1.5px solid rgba(255,255,255,.06);
      bottom: -80px; left: -100px;
      pointer-events: none;
    }
    .bp-deco-1 {
      position: absolute;
      width: 220px; height: 220px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
      top: 60px; right: -50px;
      pointer-events: none;
    }
    .bp-deco-2 {
      position: absolute;
      width: 160px; height: 160px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
      bottom: 100px; left: -30px;
      pointer-events: none;
    }
    .bp-deco-3 {
      position: absolute;
      width: 60px; height: 60px;
      border-radius: 50%;
      border: 1.5px solid rgba(255,255,255,.1);
      bottom: 40%; right: 42px;
      pointer-events: none;
    }

    .bp-top { position: relative; z-index: 1; }
    .bp-logo-wrap {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 52px;
    }
    .bp-logo {
      width: 50px; height: 50px;
      background: rgba(255,255,255,.15);
      border-radius: 13px;
      display: grid;
      place-items: center;
      flex: 0 0 50px;
      border: 1px solid rgba(255,255,255,.2);
      backdrop-filter: blur(8px);
    }
    .bp-org { font-size: 13px; font-weight: 600; opacity: .9; letter-spacing: .02em; }
    .bp-org-sub { font-size: 11px; opacity: .6; letter-spacing: .05em; margin-top: 1px; }

    .bp-heading {
      font-size: 34px;
      font-weight: 700;
      line-height: 1.22;
      letter-spacing: -.02em;
      margin-bottom: 16px;
    }
    .bp-heading span { opacity: .65; font-weight: 400; }
    .bp-desc {
      font-size: 14px;
      opacity: .7;
      line-height: 1.65;
      max-width: 320px;
      margin-bottom: 40px;
    }

    /* feature bullets */
    .bp-features { display: flex; flex-direction: column; gap: 14px; }
    .bp-feat {
      display: flex;
      align-items: flex-start;
      gap: 13px;
    }
    .bp-feat-icon {
      width: 34px; height: 34px;
      border-radius: 9px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      display: grid;
      place-items: center;
      flex: 0 0 34px;
      margin-top: 1px;
    }
    .bp-feat-icon svg { display: block; }
    .bp-feat-text strong { display: block; font-size: 13px; font-weight: 600; }
    .bp-feat-text span { font-size: 12px; opacity: .6; }

    .bp-bottom {
      position: relative;
      z-index: 1;
      font-size: 12px;
      opacity: .5;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* RIGHT — Form panel */
    .form-panel {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 24px;
      background: var(--bg);
    }
    .form-inner {
      width: 100%;
      max-width: 420px;
    }

    /* Theme toggle */
    .theme-row {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 32px;
    }
    .theme-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 50px;
      padding: 6px 14px;
      font-size: 12px;
      color: var(--text-3);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: background .15s, border-color .15s;
    }
    .theme-btn:hover { border-color: var(--red); color: var(--red); }

    /* Card */
    .login-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 40px 36px;
      box-shadow: var(--shadow-md);
    }

    .card-head { margin-bottom: 28px; }
    .card-head-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--red-soft);
      color: var(--red);
      font-size: 11.5px;
      font-weight: 600;
      letter-spacing: .04em;
      padding: 4px 11px;
      border-radius: 50px;
      margin-bottom: 14px;
    }
    .card-head-badge svg { flex: 0 0 12px; }
    .card-title {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -.02em;
      color: var(--text);
      margin-bottom: 6px;
    }
    .card-sub {
      font-size: 13.5px;
      color: var(--text-3);
    }

    /* Alert */
    .alert {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 13px 15px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 500;
      margin-bottom: 22px;
      animation: slideDown .18s ease;
    }
    .alert-err  { background: var(--red-soft); color: var(--red); }
    .alert svg  { flex: 0 0 16px; margin-top: 1px; }
    @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

    /* Form fields */
    .form-group { margin-bottom: 20px; }
    .form-group label {
      display: block;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-2);
      margin-bottom: 7px;
      letter-spacing: .01em;
    }

    .input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }
    .input-icon {
      position: absolute;
      left: 13px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-4);
      display: flex;
      pointer-events: none;
      transition: color .15s;
    }
    .field-input {
      width: 100%;
      padding: 11px 14px 11px 40px;
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      font-size: 14px;
      color: var(--text);
      outline: none;
      transition: border-color .18s, box-shadow .18s;
    }
    .field-input::placeholder { color: var(--text-4); }
    .field-input:focus {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(215,40,47,.1);
    }
    .field-input.err {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(215,40,47,.1);
    }
    .field-input:focus ~ .input-icon,
    .field-input.err ~ .input-icon { color: var(--red); }
    /* icon is before input in DOM so use sibling trick via wrapper */
    .input-wrap:focus-within .input-icon { color: var(--red-deep); }

    /* password toggle btn */
    .pw-toggle {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      padding: 4px;
      cursor: pointer;
      color: var(--text-4);
      display: flex;
      align-items: center;
      border-radius: 6px;
      transition: color .15s;
    }
    .pw-toggle:hover { color: var(--red); }

    .field-msg {
      display: none;
      font-size: 12px;
      color: var(--red);
      margin-top: 5px;
      align-items: center;
      gap: 4px;
    }
    .field-msg svg { flex: 0 0 12px; }

    /* Options row */
    .options-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
      margin-top: -4px;
    }
    .remember-label {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-size: 13px;
      color: var(--text-3);
      user-select: none;
    }
    .remember-label input[type="checkbox"] { display: none; }
    .custom-check {
      width: 17px; height: 17px;
      border: 1.5px solid var(--border);
      border-radius: 5px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color .15s, background .15s;
      flex: 0 0 17px;
    }
    .custom-check svg { opacity: 0; transition: opacity .12s; }
    .remember-label input:checked + .custom-check {
      background: var(--red);
      border-color: var(--red);
    }
    .remember-label input:checked + .custom-check svg { opacity: 1; }

    .forgot-link {
      font-size: 13px;
      color: var(--red);
      font-weight: 500;
      transition: opacity .15s;
      cursor: pointer;
    }
    .forgot-link:hover { opacity: .75; }

    /* Submit btn */
    .submit-btn {
      width: 100%;
      padding: 12px 20px;
      background: linear-gradient(135deg, var(--red-deep) 0%, #B81E29 100%);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 14.5px;
      font-weight: 600;
      letter-spacing: .01em;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: opacity .15s, transform .12s, box-shadow .15s;
      box-shadow: 0 4px 14px -4px rgba(154,22,32,.5);
      position: relative;
      overflow: hidden;
    }
    .submit-btn:hover:not(:disabled) {
      opacity: .92;
      box-shadow: 0 6px 20px -4px rgba(154,22,32,.55);
      transform: translateY(-1px);
    }
    .submit-btn:active:not(:disabled) { transform: translateY(0); }
    .submit-btn:disabled {
      opacity: .65;
      cursor: not-allowed;
      transform: none;
    }
    .btn-spinner {
      display: none;
      width: 16px; height: 16px;
      border: 2px solid rgba(255,255,255,.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .65s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .submit-btn.loading .btn-spinner { display: block; }
    .submit-btn.loading .btn-text { opacity: .7; }

    /* Divider */
    .divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 24px 0 20px;
      font-size: 12px;
      color: var(--text-4);
    }
    .divider::before, .divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    /* Footer */
    .form-footer {
      text-align: center;
      margin-top: 28px;
      font-size: 12px;
      color: var(--text-4);
      line-height: 1.6;
    }
    .form-footer strong { color: var(--text-3); font-weight: 600; }

    /* Forgot password modal / tooltip */
    .forgot-tip {
      display: none;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      font-size: 13px;
      color: var(--text-2);
      line-height: 1.55;
      margin-top: 16px;
      box-shadow: var(--shadow-md);
      animation: slideDown .18s ease;
    }
    .forgot-tip.show { display: block; }
    .forgot-tip strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 13px; }

    /* ── Responsive ───────────────────────────────────────────── */
    @media (max-width: 900px) {
      .brand-panel { flex: 0 0 40%; padding: 40px 36px; }
      .bp-heading { font-size: 26px; }
      .bp-desc, .bp-features { display: none; }
    }
    @media (max-width: 700px) {
      .login-page { flex-direction: column; }
      .brand-panel {
        flex: none;
        padding: 28px 24px 32px;
        min-height: auto;
      }
      .bp-logo-wrap { margin-bottom: 0; }
      .bp-heading, .bp-desc, .bp-features, .bp-bottom { display: none; }
      .form-panel { padding: 28px 16px 40px; }
      .login-card { padding: 28px 22px; }
    }
    @media (max-width: 400px) {
      .login-card { padding: 24px 18px; border-radius: 14px; }
      .card-title { font-size: 19px; }
    }
