@charset "UTF-8";

:root {
      --red:    #d42f2f;
      --red-dk: #a81e1e;
      --navy:   #0d1b3e;
      --white:  #ffffff;
      --border: #e2e5ef;
      --muted:  #7a84a3;
      --text:   #1e2740;
      --green:  #1aad64;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body {
      height: 100%; font-family: 'Be Vietnam Pro', sans-serif;
      background: var(--navy); overflow: hidden;
    }

    /* ── Animated background ── */
    .bg-layer {
      position: fixed; inset: 0; z-index: 0;
      background: linear-gradient(135deg, #0d1b3e 0%, #1a2f6e 50%, #0d1b3e 100%);
    }
    .bg-grid {
      position: fixed; inset: 0; z-index: 1; opacity: .04;
      background-image:
        linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
      background-size: 48px 48px;
    }
    .bg-glow {
      position: fixed; z-index: 1; border-radius: 50%; filter: blur(80px); pointer-events: none;
    }
    .bg-glow-1 { width: 600px; height: 600px; background: rgba(212,47,47,.18); top: -200px; right: -100px; animation: drift1 8s ease-in-out infinite alternate; }
    .bg-glow-2 { width: 400px; height: 400px; background: rgba(98,84,232,.12); bottom: -100px; left: -80px; animation: drift2 10s ease-in-out infinite alternate; }
    .bg-glow-3 { width: 300px; height: 300px; background: rgba(26,173,100,.1); top: 40%; left: 30%; animation: drift3 7s ease-in-out infinite alternate; }

    @keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,30px) scale(1.1); } }
    @keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(-30px,40px) scale(1.05); } }
    @keyframes drift3 { from { transform: translate(0,0); } to { transform: translate(20px,-20px); } }

    /* ── Floating particles ── */
    .particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
    .particle {
      position: absolute; border-radius: 50%;
      background: rgba(255,255,255,.15);
      animation: float linear infinite;
    }

    @keyframes float {
      0%   { transform: translateY(100vh) scale(0); opacity: 0; }
      10%  { opacity: 1; }
      90%  { opacity: 1; }
      100% { transform: translateY(-10vh) scale(1); opacity: 0; }
    }

    /* ── Split layout ── */
    .login-wrap {
      position: relative; z-index: 10;
      display: flex; height: 100vh; align-items: stretch;
    }

    /* Left panel */
    .left-panel {
      flex: 0 0 52%; display: flex; flex-direction: column;
      justify-content: center; padding: 60px 64px;
      position: relative; overflow: hidden;
    }
    .left-panel::after {
      content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
      background: linear-gradient(to bottom, transparent, rgba(255,255,255,.12) 30%, rgba(255,255,255,.12) 70%, transparent);
    }

    .brand-mark {
      display: flex; align-items: center; gap: 14px; margin-bottom: 56px;
      animation: fadeSlideDown .6s ease both;
    }
    .brand-icon-big {
      width: 52px; height: 52px; border-radius: 14px;
      background: var(--red); display: flex; align-items: center; justify-content: center;
      font-size: 22px; color: #fff;
      box-shadow: 0 8px 24px rgba(212,47,47,.5);
    }
    .brand-name { color: #fff; }
    .brand-name strong { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
    .brand-name span { font-size: 11px; color: rgba(255,255,255,.4); letter-spacing: 2px; text-transform: uppercase; }

    .hero-heading {
      animation: fadeSlideDown .7s .1s ease both;
    }
    .hero-heading h1 {
      font-size: clamp(28px,3vw,42px); font-weight: 900;
      color: #fff; line-height: 1.15; letter-spacing: -.5px;
      margin-bottom: 16px;
    }
    .hero-heading h1 em { color: var(--red); font-style: normal; }
    .hero-heading p { font-size: 15px; color: rgba(255,255,255,.45); line-height: 1.7; max-width: 400px; }

    .feature-list { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; animation: fadeSlideDown .8s .2s ease both; }
    .feature-item { display: flex; align-items: center; gap: 14px; }
    .feature-icon {
      width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
      background: rgba(255,255,255,.07); display: flex; align-items: center;
      justify-content: center; font-size: 16px; color: rgba(255,255,255,.6);
    }
    .feature-item span { font-size: 13px; color: rgba(255,255,255,.5); }

    .version-tag {
      margin-top: 48px; display: inline-flex; align-items: center; gap: 6px;
      background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
      padding: 6px 14px; border-radius: 20px; font-size: 11px; color: rgba(255,255,255,.4);
      animation: fadeSlideDown .9s .3s ease both;
    }
    .version-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

    /* Right panel */
    .right-panel {
      flex: 1; display: flex; align-items: center; justify-content: center;
      padding: 40px 48px;
    }

    .login-card {
      width: 100%; max-width: 420px;
      animation: fadeSlideUp .6s .1s ease both;
    }

    .login-card-header { margin-bottom: 32px; }
    .login-card-header h2 { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 6px; }
    .login-card-header p  { font-size: 13px; color: rgba(255,255,255,.4); }

    .form-field { margin-bottom: 18px; }
    .field-label {
      display: block; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.4);
      text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px;
    }
    .field-wrap { position: relative; }
    .field-wrap .fi { /* field icon */
      position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
      color: rgba(255,255,255,.25); font-size: 16px; pointer-events: none;
    }
    .field-input {
      width: 100%; background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
      padding: 13px 14px 13px 42px;
      font-size: 14px; color: #fff; font-family: inherit; outline: none;
      transition: border .15s, background .15s, box-shadow .15s;
    }
    .field-input::placeholder { color: rgba(255,255,255,.2); }
    .field-input:focus {
      border-color: var(--red);
      background: rgba(255,255,255,.09);
      box-shadow: 0 0 0 3px rgba(212,47,47,.2);
    }
    .field-input.shake { animation: shake .35s ease; }
    @keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 60%{transform:translateX(6px)} 80%{transform:translateX(-3px)} }

    .pw-toggle {
      position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
      background: none; border: none; color: rgba(255,255,255,.3); cursor: pointer;
      font-size: 16px; padding: 0; transition: color .15s;
    }
    .pw-toggle:hover { color: rgba(255,255,255,.7); }

    .field-hint { font-size: 11px; color: rgba(255,255,255,.25); margin-top: 6px; }

    .remember-row {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 24px;
    }
    .remember-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
    .remember-check input { accent-color: var(--red); width: 15px; height: 15px; }
    .remember-check span { font-size: 13px; color: rgba(255,255,255,.4); }
    .forgot-link { font-size: 13px; color: rgba(212,47,47,.8); text-decoration: none; }
    .forgot-link:hover { color: var(--red); }

    .btn-login {
      width: 100%; padding: 14px; border: none; border-radius: 10px;
      background: var(--red); color: #fff; font-size: 15px; font-weight: 700;
      font-family: inherit; cursor: pointer; letter-spacing: .3px;
      display: flex; align-items: center; justify-content: center; gap: 8px;
      transition: background .15s, box-shadow .15s, transform .1s;
      position: relative; overflow: hidden;
    }
    .btn-login::before {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
      pointer-events: none;
    }
    .btn-login:hover { background: var(--red-dk); box-shadow: 0 8px 24px rgba(212,47,47,.4); transform: translateY(-1px); }
    .btn-login:active { transform: translateY(0); }
    .btn-login.loading { pointer-events: none; opacity: .8; }

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

    .error-msg {
      background: rgba(212,47,47,.15); border: 1px solid rgba(212,47,47,.3);
      border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #ff8080;
      margin-bottom: 18px; display: none; align-items: center; gap: 8px;
    }
    .error-msg.show { display: flex; }

    .divider { position: relative; text-align: center; margin: 24px 0; }
    .divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: rgba(255,255,255,.08); }
    .divider span { position: relative; background: transparent; padding: 0 14px; font-size: 12px; color: rgba(255,255,255,.25); }

    .demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .demo-btn {
      background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
      border-radius: 8px; padding: 10px 12px; cursor: pointer; text-align: left;
      transition: all .15s; font-family: inherit;
    }
    .demo-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
    .demo-btn .db-role { font-size: 11px; color: rgba(255,255,255,.3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
    .demo-btn .db-name { font-size: 12px; color: rgba(255,255,255,.65); font-weight: 600; margin-top: 2px; }

    @keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes fadeSlideUp   { from { opacity: 0; transform: translateY(16px); }  to { opacity: 1; transform: translateY(0); } }

    /* ── Login tabs ── */
    .login-tabs {
      display: flex; gap: 4px; margin-bottom: 20px;
      background: #f0f2f8; border-radius: 10px; padding: 4px;
    }
    .login-tab {
      flex: 1; padding: 8px 12px; border: none; border-radius: 7px;
      font-family: inherit; font-size: 13px; font-weight: 600;
      color: var(--muted); background: transparent; cursor: pointer;
      transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 6px;
    }
    .login-tab.active { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
    .login-tab:hover:not(.active) { color: var(--text); }

    /* ── Success message ── */
    .success-msg {
      display: none; align-items: center; gap: 10px;
      background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 10px;
      padding: 12px 16px; margin-bottom: 18px; color: #065f46;
    }
    .success-msg.show { display: flex; animation: fadeSlideDown .25s ease; }

    /* ── OTP styles ── */
    .otp-sent-notice {
      display: flex; align-items: center; gap: 10px;
      background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
      padding: 12px 14px; margin-bottom: 18px; font-size: 13px; color: #1e40af;
    }
    .otp-sent-notice i { font-size: 18px; flex-shrink: 0; }
    .otp-input { letter-spacing: 6px; font-size: 22px; font-weight: 700; text-align: center; }
    .otp-countdown { font-size: 12px; font-weight: 600; color: var(--red); margin-left: 6px; }

    /* ── Mobile ── */
    @media (max-width: 768px) {
      .left-panel { display: none; }
      .right-panel { padding: 24px 20px; }
      body { overflow: auto; }
      html, body { height: auto; min-height: 100vh; }
      .login-wrap { min-height: 100vh; }
    }
