/* ==================== RESET & BASE ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #0066cc;
  --primary-dark: #004fa3;
  --primary-light:#e8f0fb;
  --accent:       #ff6b00;
  --success:      #28a745;
  --danger:       #dc3545;
  --text:         #222;
  --muted:        #666;
  --border:       #d0d7e3;
  --bg:           #f0f4fa;
  --white:        #ffffff;
  --shadow:       0 4px 24px rgba(0,60,140,.13);
  --radius:       10px;
  --font:         'Segoe UI', Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==================== HEADER ==================== */
.site-header {
  background: linear-gradient(90deg, #003a8c 0%, #0062d1 60%, #1a85ff 100%);
  padding: 0 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-text { color: #fff; font-size: 1.4rem; font-weight: 700; letter-spacing: 1px; }
.logo-text span { color: #ffd700; }
.header-links { display: flex; align-items: center; gap: 4px; }
.header-links a { color: #c8dcff; font-size: .9rem; margin-left: 18px; }
.header-links a:hover { color: #fff; text-decoration: underline; }
.header-links .header-user { color: #c8dcff; font-size: .9rem; }

/* ==================== MAIN LAYOUT ==================== */
.page-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 36px 16px;
}

/* ==================== CARD ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%; max-width: 420px;
  padding: 36px 36px 28px;
  border-top: 4px solid var(--primary);
}
.card-wide { max-width: 700px; }
.card-title {
  font-size: 1.3rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 22px; text-align: center;
}
.card-title::after {
  content: ''; display: block; width: 48px; height: 3px;
  background: var(--accent); margin: 8px auto 0;
  border-radius: 2px;
}

/* ==================== FORM ==================== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: .88rem; color: var(--muted); font-weight: 600;
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: .97rem; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  background: #fcfcff;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,204,.12);
  background: #fff;
}
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: .8rem; margin-top: 4px; display: block; }
.invalid-loi { color: var(--danger); font-size: .8rem; margin-top: 4px; display: block; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-right: 42px; }
.input-icon-wrap .toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--muted); font-size: 1.1rem; background: none; border: none;
}
.input-icon-wrap .toggle-pw:hover { color: var(--primary); }

.form-row{ display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: 6px; font-size: 1rem; font-weight: 600;
  cursor: pointer; border: none; transition: background .18s, box-shadow .18s;
  letter-spacing: .3px; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,80,200,.22);
  width: 100%; margin-top: 6px;
}
.btn-primary:hover { background: linear-gradient(90deg, #00408a, #0058b8); box-shadow: 0 5px 16px rgba(0,80,200,.3); }
.btn-outline {
  background: #fff; color: var(--primary); border: 1.5px solid var(--primary);
  width: 100%; margin-top: 8px;
}
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 7px 16px; font-size: .85rem; width: auto; margin: 0; }

/* ==================== AVATAR UPLOAD ==================== */
.avatar-upload { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.avatar-preview {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--primary-light); border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--primary); overflow: hidden; flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-actions { display: flex; flex-direction: column; gap: 8px; }

/* ==================== PASSWORD STRENGTH ==================== */
.pw-strength { margin-top: 6px; }
.pw-strength-bar {
  height: 5px; border-radius: 3px; background: var(--border);
  overflow: hidden; margin-bottom: 3px;
}
.pw-strength-fill { height: 100%; border-radius: 3px; transition: width .3s, background .3s; width: 0; }
.pw-strength-text { font-size: .75rem; color: var(--muted); }

/* ==================== CAPTCHA ==================== */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-box {
  background: #f0f4fa; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 7px 14px; font-size: 1.15rem; font-weight: 700; letter-spacing: 8px;
  color: var(--primary-dark); user-select: none; min-width: 110px; text-align: center;
  font-family: 'Courier New', monospace;
}
.captcha-refresh { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.2rem; }
.captcha-refresh:hover { color: var(--primary); }

/* ==================== PROGRESS STEPS ==================== */
.steps {
  display: flex; align-items: center; justify-content: center; margin-bottom: 28px; gap: 0;
}
.step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 14px; left: 60%; width: 80%; height: 2px;
  background: var(--border); z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--primary); }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--border);
  color: var(--muted); font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--success); color: #fff; }
.step-label { font-size: .75rem; color: var(--muted); margin-top: 4px; text-align: center; }
.step.active .step-label { color: var(--primary); font-weight: 600; }

/* ==================== OTP ==================== */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.otp-input {
  width: 48px; height: 52px; text-align: center; font-size: 1.5rem; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: 6px; outline: none;
  transition: border-color .2s;
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,.12); }

/* ==================== ALERT ==================== */
.alert {
  padding: 10px 14px; border-radius: 6px; font-size: .88rem;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.alert-danger  { background: #fff0f0; border: 1px solid #f5c6cb; color: #c00; }
.alert-success { background: #f0fff4; border: 1px solid #b8e6c8; color: #1a6b33; }
.alert-info    { background: #e8f4ff; border: 1px solid #b3d5f7; color: #0055a5; }
.alert ul { margin: 0; padding-left: 16px; }
.alert li { margin-bottom: 2px; }

/* ==================== FOOTER LINKS ==================== */
.card-footer-links {
  margin-top: 18px; text-align: center; font-size: .85rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 14px;
}
.card-footer-links a { color: var(--primary); font-weight: 600; margin: 0 5px; }

/* ==================== CHECKBOX ==================== */
.form-check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.form-check input[type=checkbox] {
  width: 16px; height: 16px; margin-top: 2px;
  accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.form-check label { font-size: .85rem; color: var(--muted); cursor: pointer; line-height: 1.5; }

/* ==================== LOGIN LAYOUT ==================== */
.login-wrap { display: flex; gap: 0; max-width: 820px; width: 100%; }
.login-banner {
  flex: 1; background: linear-gradient(145deg, #003a8c 0%, #0062d1 55%, #1a85ff 100%);
  border-radius: var(--radius) 0 0 var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 36px; color: #fff; text-align: center;
}
.login-banner .big-logo { font-size: 3rem; font-weight: 900; letter-spacing: 2px; margin-bottom: 16px; }
.login-banner .big-logo span { color: #ffd700; }
.login-banner .banner-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; }
.login-banner .banner-desc { color: #c8dcff; font-size: .95rem; line-height: 1.7; margin-bottom: 28px; }
.btn-register-big {
  display: inline-block; padding: 14px 40px; font-size: 1.05rem; font-weight: 700;
  color: #003a8c; background: #ffd700; border: none; border-radius: 8px;
  cursor: pointer; text-decoration: none; transition: background .2s, transform .15s;
  letter-spacing: .5px;
}
.btn-register-big:hover { background: #ffe44d; transform: translateY(-2px); text-decoration: none; }
.login-card {
  background: var(--white); border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow); width: 360px; flex-shrink: 0; padding: 36px 32px 28px;
  border-top: 4px solid var(--primary);
}

/* ==================== DASHBOARD ==================== */
.dashboard { display: flex; gap: 24px; align-items: flex-start; }
.sidebar {
  width: 200px; flex-shrink: 0; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.sidebar-avatar {
  background: linear-gradient(135deg, #003a8c, #1a85ff);
  padding: 24px 16px 18px; text-align: center;
}
.avatar-circle {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: var(--primary);
  border: 3px solid rgba(255,255,255,.5);
}
.sidebar-username { color: #fff; font-weight: 700; font-size: 1rem; }
.sidebar-email { color: #b0c8ff; font-size: .78rem; word-break: break-all; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; color: var(--text); font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent; transition: background .15s;
}
.sidebar-nav a:hover { background: var(--primary-light); text-decoration: none; }
.sidebar-nav a.active {
  color: var(--primary); border-left-color: var(--primary); background: var(--primary-light); font-weight: 700;
}
.sidebar-nav a .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.content-area { flex: 1; }
.content-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px;
}
.section-title {
  font-size: 1.05rem; font-weight: 700; color: var(--primary);
  margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* ==================== INFO ROW (account) ==================== */
.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .9rem; font-weight: 600; }
.info-value { font-size: .85rem; color: var(--muted); }
.info-right { display: flex; align-items: center; gap: 10px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .85rem; font-weight: 600; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ==================== BADGE ==================== */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700;
}
.badge-success { background: #e0f7ea; color: #1a6b33; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #fde8e8; color: #c00; }

/* ==================== TOPUP ==================== */
.topup-wrap { max-width: 520px; width: 100%; }
.topup-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 32px 28px;
  border-top: 4px solid var(--primary);
}
.topup-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px;
}
.topup-opt {
  padding: 16px; font-size: .95rem; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.topup-opt.selected { border-color: var(--primary); border-width: 2px; box-shadow: 0 0 0 3px rgba(0,98,209,.15); }
.qr-info {
  text-align: left; background: #f0f5ff; border-radius: 8px;
  padding: 16px; margin-bottom: 16px; font-size: .88rem; line-height: 1.8;
}
.balance-bar {
  background: linear-gradient(135deg, #003a8c, #0062d1);
  border-radius: 10px; padding: 18px 24px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 8px;
}
.balance-bar .bal-label { font-size: .82rem; opacity: .8; }
.balance-bar .bal-value { font-size: 1.5rem; font-weight: 900; }

/* ==================== MODAL ==================== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); padding: 28px 30px;
  max-width: 420px; width: 90%; box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.modal-close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

/* ==================== FOOTER ==================== */
.site-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 14px 20px; text-align: center; font-size: .8rem; color: var(--muted);
}
.site-footer a { color: var(--muted); margin: 0 8px; }
.site-footer a:hover { color: var(--primary); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 680px) {
  .login-wrap { flex-direction: column; }
  .login-banner { border-radius: var(--radius) var(--radius) 0 0; padding: 28px 20px; }
  .login-card { width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 640px) {
  .card { padding: 24px 16px 20px; }
  .dashboard { flex-direction: column; }
  .sidebar { width: 100%; }
  .header-inner { padding: 8px 12px; }
  .form-row { flex-direction: column; gap: 0; }
  .topup-grid { grid-template-columns: 1fr; }
  .topup-card { padding: 24px 16px 20px; }
}
