:root {
  --bg: oklch(99% 0.005 350);
  --surface: oklch(100% 0 0);
  --fg: oklch(20% 0.02 350);
  --muted: oklch(55% 0.02 350);
  --border: oklch(92% 0.01 350);
  --accent: oklch(56% 0.22 350);
  --accent-secondary: oklch(60% 0.18 145);
  --font-body: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --danger: oklch(55% 0.2 20);
}

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

body {
  font-family: var(--font-body);
  color: var(--fg);
  background-color: var(--bg);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.mt-4 { margin-top: 16px; }

/* Bố cục chia đôi màn hình */
.auth-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.auth-banner {
  flex: 1;
  background: linear-gradient(135deg, #123C69 0%, #1E5F74 65%, #E9EEF5 160%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
              radial-gradient(circle at bottom left, rgba(216, 27, 96, 0.5) 0%, transparent 60%);
  filter: blur(24px);
  opacity: 0.9;
  pointer-events: none;
}

.auth-banner::after {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 120px;
  background: linear-gradient(to right, transparent, #E2E8F0);
  pointer-events: none;
  z-index: 2;
}

.banner-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 400px;
}

.banner-icon {
  width: 96px;
  height: 96px;
  background: white;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 36px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.2);
  overflow: hidden;
  padding: 14px;
}

.banner-icon img {
  width: 100%;
  height: auto;
}

.banner-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.banner-subtitle {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.92;
  color: #ffffff;
  max-width: 340px;
  margin: 0 auto;
}

/* Phần biểu mẫu */
.auth-form-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E2E8F0;
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.06);
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.card-desc {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.5;
}
.card-desc strong {
  color: var(--fg);
  font-weight: 600;
}

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  transition: all 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.forgot-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.submit-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 24px;
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled { background: var(--muted); cursor: not-allowed; opacity: 0.5; }

.register-wrapper {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.register-wrapper a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.register-wrapper a:hover { text-decoration: underline; }

.mobile-logo {
  display: none;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  background: white;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 8px;
}
.mobile-logo img {
  width: 100%;
  height: auto;
}

/* OTP Screen components */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 32px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--fg); }
.back-link svg { width: 16px; height: 16px; }

.otp-inputs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: space-between;
}

.otp-field {
  width: 48px;
  height: 56px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  color: var(--fg);
  background: var(--bg);
  transition: all 0.2s;
}
.otp-field:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1);
}

.otp-timer {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}
.time-highlight {
  color: var(--accent);
  font-weight: 700;
}
.error-text {
  color: var(--danger);
  font-weight: 600;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 16px;
}

.btn-link {
  background: transparent;
  color: var(--accent);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-link:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

.resend-wrapper {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* Alert boxes */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1.5px solid oklch(85% 0.15 20);
  background: oklch(97% 0.04 20);
  color: oklch(45% 0.18 20);
  line-height: 1.4;
}
.alert svg {
  flex-shrink: 0;
  color: oklch(50% 0.18 20);
}

/* Demo accounts */
.tips-box {
  margin-top: 24px;
  background: oklch(98% 0.01 350);
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  max-width: 440px;
  width: 100%;
  font-size: 13.5px;
  color: var(--muted);
  box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}
.demo-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.demo-account-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.demo-account-item:hover {
  border-color: var(--accent);
  background: oklch(97% 0.02 350);
}

/* Responsive */
@media (max-width: 768px) {
  .auth-banner { display: none; }
  .auth-form-wrapper { 
    align-items: flex-start; 
    padding: 32px 20px; 
    background: var(--surface);
  }
  .auth-card {
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .mobile-logo {
    display: flex;
  }
  .card-title { font-size: 24px; }
  .otp-inputs { gap: 8px; }
  .otp-field { width: 44px; height: 52px; font-size: 20px; }
}
