:root {
  /* Real Kolia Phan brand colors (verified from koliaphan.com) */
  --gold: #ffc90a;
  --gold-light: #ffd84d;
  --gold-dark: #d9ab00;
  --gold-glow: rgba(255, 201, 10, 0.22);
  --gold-soft: rgba(255, 201, 10, 0.08);
  --dark: #18181b;
  --dark-soft: #232323;
  --dark-deep: #040404;

  --gray-900: #18181b;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-400: #9ca3af;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50: #FAFAFA;
  --white: #FFFFFF;

  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================
   LOGIN PAGE
   ========================= */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--dark);
}

/* ---- Left: Brand panel ---- */
.login-brand {
  flex: 1;
  background: var(--dark);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  color: #fff;
  overflow: hidden;
}

/* Background image — Forbes Top 6 (nền tài chính: biểu đồ, chữ, huy chương) */
.brand-bg-image {
  position: absolute;
  inset: 0;
  background-image: url('../assets/forbes-top6.png');
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  background-color: var(--dark);
  z-index: 0;
}

/* Lớp người mới (founders.png — ảnh đã tách nền) đặt chồng lên nền tài chính,
   căn giữa-dưới để che 2 người cũ trong ảnh nền. Bỏ file vào assets/founders.png. */
.brand-people-image {
  position: absolute;
  inset: 0;
  background-image: url('../assets/founders.png');
  background-size: contain;
  background-position: right bottom;
  background-repeat: no-repeat;
  z-index: 1;
  pointer-events: none;
}

/* Dark gradient overlay — heavier on left for text readability */
.brand-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(95deg,
      rgba(24, 24, 27, 1) 0%,
      rgba(24, 24, 27, 0.92) 25%,
      rgba(24, 24, 27, 0.45) 50%,
      rgba(24, 24, 27, 0.1) 75%,
      rgba(24, 24, 27, 0.05) 100%);
  z-index: 2;
}

.brand-logo {
  position: relative;
  z-index: 3;
}

.brand-logo img {
  height: 44px;
  width: auto;
  filter: brightness(0) invert(1);
}

.brand-content {
  position: relative;
  z-index: 3;
  max-width: 480px;
}

.brand-content .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.brand-content .eyebrow::before {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--gold);
}

.brand-content h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-content h1 .accent {
  color: var(--gold);
  position: relative;
  display: inline-block;
}

.brand-content h1 .accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255, 201, 10, 0.18);
  z-index: -1;
}

.brand-content p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.65;
  margin-bottom: 30px;
}


.brand-footer {
  position: relative;
  z-index: 3;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-footer .gold-line {
  height: 1px;
  width: 60px;
  background: var(--gold);
  opacity: 0.6;
}

/* ---- Right: Form panel ---- */
.login-form-wrap {
  width: 480px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
}

.login-form-wrap .form-mobile-logo {
  display: none;
  margin-bottom: 24px;
}

.login-form-wrap .form-mobile-logo img {
  height: 36px;
}

.login-form-wrap .form-header {
  margin-bottom: 36px;
}

.login-form-wrap .form-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-form-wrap .form-header p {
  color: var(--gray-500);
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
}

.input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  transition: all 0.18s;
  outline: none;
  font-family: inherit;
}

.input-wrap input::placeholder { color: var(--gray-400); }

.input-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.input-wrap input:focus-visible {
  outline: 3px solid var(--gold-dark);
  outline-offset: 3px;
}

.input-wrap input:focus + .icon,
.input-wrap input:focus ~ .icon { color: var(--gold-dark); }

.input-wrap .toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--gray-500);
  font-size: 12.5px;
  user-select: none;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.input-wrap .toggle-pwd:hover { color: var(--gold-dark); background: var(--gold-soft); }

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  font-size: 13px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.remember input {
  accent-color: var(--gold-dark);
  width: 15px;
  height: 15px;
}

.forgot-link {
  color: var(--gold-dark);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.forgot-link:hover { color: var(--dark); text-decoration: underline; }

.base-login-icon {
  width: 19px;
  height: 19px;
  flex: none;
}

.login-form-wrap > .fi-btn,
.base-popup-card .fi-btn {
  min-height: 44px;
  padding: 10px 16px;
}

.base-login-recovery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 8px;
  color: var(--gray-700);
  font-size: 14px;
}
.base-login-recovery a,
.base-login-recovery button,
.base-popup-close {
  padding: 10px 0;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.base-login-recovery [hidden] { display: none; }
.base-login-recovery button { padding-inline: 12px; }
.base-popup-close { margin-top: 12px; }
.base-login-recovery :focus-visible,
.base-popup-close:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }

.base-login-status {
  position: relative;
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--gray-700);
  font-size: 12.5px;
  line-height: 1.55;
}

.base-login-status::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: base-login-spin 0.8s linear infinite;
}

.base-login-status[data-state="success"] { color: #166534; }
.base-login-status[data-state="error"] { color: #991b1b; }

.base-login-status[data-state="success"]::before,
.base-login-status[data-state="error"]::before {
  animation: none;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  width: 8px;
  height: 8px;
  top: 6px;
  left: 3px;
}

@keyframes base-login-spin {
  to { transform: rotate(360deg); }
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 14px;
  color: var(--gray-400);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.demo-accounts {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 6px;
  font-size: 12.5px;
  overflow: hidden;
}

.demo-accounts .acc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.demo-accounts .acc-row:hover {
  background: var(--gold-soft);
}

.demo-accounts .acc-row .name {
  color: var(--gray-700);
}

.demo-accounts .acc-row .name b {
  color: var(--dark);
  font-weight: 600;
}

.demo-accounts .acc-row .role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-700);
}

.demo-accounts .acc-row .role.owner {
  background: var(--gold);
  color: var(--dark);
}

.demo-accounts .acc-row .role.admin {
  background: var(--dark);
  color: var(--gold);
}

.demo-accounts .acc-row .role.qltt {
  background: rgba(255, 201, 10, 0.15);
  color: var(--gold-dark);
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.error-box.show { display: block; }

.source-hint {
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
}

.source-hint + .source-hint {
  margin-top: 12px;
}

.form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  padding-top: 18px;
  border-top: 1px solid var(--gray-100);
}

.form-footer b { color: var(--gold-dark); font-family: 'SF Mono', Monaco, 'Courier New', monospace; }

/* Responsive */
@media (max-width: 960px) {
  .login-brand { display: none; }
  .login-form-wrap {
    width: 100%;
    padding: 40px 28px;
  }
  .login-form-wrap .form-mobile-logo { display: block; }
}

/* Trang kết quả ngắn trong popup SSO Base */
.base-popup-result {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--gray-50);
}

.base-popup-card {
  width: min(100%, 400px);
  padding: 36px;
  text-align: center;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.base-popup-logo {
  width: auto;
  height: 38px;
  margin-bottom: 26px;
}

.base-popup-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.base-popup-mark svg { width: 25px; height: 25px; }
.base-popup-mark.is-success { color: #166534; background: #dcfce7; }
.base-popup-mark.is-error { color: #991b1b; background: #fee2e2; }

.base-popup-card h1 {
  margin: 0 0 10px;
  color: var(--dark);
  font-size: 22px;
}

.base-popup-card p {
  margin: 0 0 24px;
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
  .base-login-status::before { animation: none; }
}
