/* ============================================
   WIZARD STYLES - Bảng cung cấp thông tin tư vấn
   Material You design - Midnight Blue + Gold + Cream
   ============================================ */

:root {
  --wiz-midnight: #0A1F44;
  --wiz-midnight-2: #1a3a6e;
  --wiz-gold: #D4B886;
  --wiz-gold-2: #c4a878;
  --wiz-cream: #F8F5EE;
  --wiz-bg: #fafbfc;
  --wiz-text: #1a202c;
  --wiz-text-2: #4a5568;
  --wiz-text-3: #718096;
  --wiz-border: #e2e8f0;
  --wiz-success: #16a34a;
  --wiz-warning: #d97706;
  --wiz-danger: #dc2626;
  --wiz-info: #2563eb;
  --wiz-radius: 12px;
  --wiz-radius-lg: 16px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--wiz-bg);
  color: var(--wiz-text);
  margin: 0;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.wiz-header {
  background: var(--wiz-midnight);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.wiz-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wiz-logo {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.wiz-logo span { color: var(--wiz-gold); }
.wiz-step-indicator {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  background: rgba(255,255,255,0.1);
  border-radius: 9999px;
}
.wiz-progress {
  height: 3px;
  background: rgba(255,255,255,0.15);
}
.wiz-progress-bar {
  height: 100%;
  background: var(--wiz-gold);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== MAIN ===== */
.wiz-main {
  min-height: calc(100vh - 120px);
  padding: 2rem 1.5rem 4rem;
}
.wiz-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

/* ===== SIDEBAR ===== */
.wiz-sidebar {
  background: white;
  border-radius: var(--wiz-radius-lg);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wiz-sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wiz-text-3);
  margin: 0 0 1rem 0;
  font-weight: 600;
}
.wiz-step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  counter-reset: wiz-step;
}
.wiz-step-list li {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--wiz-text-2);
  transition: all 0.2s;
}
.wiz-step-list li:hover { background: var(--wiz-cream); }
.wiz-step-list li.active {
  background: var(--wiz-midnight);
  color: white;
  font-weight: 500;
}
.wiz-step-list li.completed { color: var(--wiz-success); }
.wiz-step-list li.completed .num { background: var(--wiz-success); color: white; }
.wiz-step-list .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--wiz-cream);
  color: var(--wiz-text-2);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.6rem;
  flex-shrink: 0;
}
.wiz-step-list li.active .num { background: var(--wiz-gold); color: var(--wiz-midnight); }
.wiz-auto-save {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--wiz-text-3);
  padding-top: 1rem;
  border-top: 1px solid var(--wiz-border);
}
.wiz-auto-save .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wiz-success);
  margin-right: 0.5rem;
  animation: wiz-pulse 2s infinite;
}
.wiz-auto-save.saving .dot { background: var(--wiz-warning); }
.wiz-auto-save.error .dot { background: var(--wiz-danger); }
@keyframes wiz-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== FORM AREA ===== */
.wiz-form-area {
  background: white;
  border-radius: var(--wiz-radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wiz-step { animation: wiz-fade 0.4s; }
@keyframes wiz-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.wiz-step h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--wiz-midnight);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}
.wiz-step h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--wiz-midnight);
  margin: 1.5rem 0 0.8rem 0;
}
.wiz-step h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--wiz-midnight);
  margin: 1.5rem 0 0.6rem 0;
}
.wiz-step-desc {
  color: var(--wiz-text-2);
  font-size: 0.95rem;
  margin: 0 0 2rem 0;
}
.required { color: var(--wiz-danger); font-weight: 600; }
.optional { color: var(--wiz-text-3); font-weight: 400; font-size: 0.85rem; }

/* Grid layout */
.wiz-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.wiz-field {
  display: flex;
  flex-direction: column;
}
.wiz-field.wiz-full { grid-column: 1 / -1; }
.wiz-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wiz-text-2);
  margin-bottom: 0.4rem;
}
.wiz-field input,
.wiz-field select,
.wiz-field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--wiz-border);
  border-radius: 8px;
  background: white;
  color: var(--wiz-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wiz-field input:focus,
.wiz-field select:focus,
.wiz-field textarea:focus {
  outline: none;
  border-color: var(--wiz-midnight);
  box-shadow: 0 0 0 3px rgba(10, 31, 68, 0.1);
}
.wiz-field input.error,
.wiz-field select.error { border-color: var(--wiz-danger); }
.wiz-field .err-msg {
  color: var(--wiz-danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}
.wiz-field .err-msg.show { display: block; }

/* ===== TABLE ===== */
.wiz-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.wiz-table th, .wiz-table td {
  border: 1px solid var(--wiz-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: middle;
}
.wiz-table th {
  background: var(--wiz-cream);
  font-weight: 600;
  color: var(--wiz-midnight);
  font-size: 0.85rem;
}
.wiz-table input,
.wiz-table select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--wiz-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: white;
}
.wiz-table input:focus,
.wiz-table select:focus {
  outline: none;
  border-color: var(--wiz-midnight);
}
.wiz-section-row td {
  background: var(--wiz-cream) !important;
  font-weight: 600;
  color: var(--wiz-midnight);
}
.wiz-total-row td {
  background: #f0f4fa;
  font-weight: 700;
  color: var(--wiz-midnight);
  font-size: 0.95rem;
}
.wiz-surplus-row td {
  background: #e8f5e9;
  font-weight: 700;
  color: var(--wiz-success);
}
.auto-total {
  background: #f8f9fb;
  color: var(--wiz-text-2);
  font-weight: 500;
}

/* ===== BUTTONS ===== */
.wiz-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wiz-btn-primary {
  background: var(--wiz-midnight);
  color: white;
}
.wiz-btn-primary:hover { background: var(--wiz-midnight-2); }
.wiz-btn-secondary {
  background: var(--wiz-cream);
  color: var(--wiz-midnight);
  border: 1.5px solid var(--wiz-border);
}
.wiz-btn-secondary:hover { background: #efe9dc; }
.wiz-btn-text {
  background: transparent;
  color: var(--wiz-info);
  padding: 0.5rem 1rem;
}
.wiz-btn-text:hover { text-decoration: underline; }
.wiz-btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.wiz-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== NAV ===== */
.wiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--wiz-border);
}

/* ===== CHECKBOXES ===== */
.wiz-check {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
}
.wiz-check:hover { background: var(--wiz-cream); }
.wiz-check input[type="checkbox"] {
  margin-right: 0.6rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--wiz-midnight);
}
.wiz-goal-group {
  margin: 1rem 0 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--wiz-cream);
  border-radius: var(--wiz-radius);
}
.wiz-goal-group h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: var(--wiz-midnight);
}
.wiz-check-row { margin: 0.75rem 0; }

/* ===== INFO BOX ===== */
.wiz-info-box {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff8e6;
  border-left: 4px solid var(--wiz-gold);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--wiz-text-2);
}

/* ===== EMAIL BOX ===== */
.wiz-email-box {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem;
  background: var(--wiz-cream);
  border-radius: var(--wiz-radius-lg);
}
.wiz-email-box label {
  display: block;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--wiz-text-2);
}
.wiz-email-box input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--wiz-border);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.wiz-hint {
  font-size: 0.85rem;
  color: var(--wiz-text-3);
  margin: 0.5rem 0;
}

/* ===== DEPENDENTS / BDS dynamic ===== */
.dependent-row, .bds-row {
  background: var(--wiz-cream);
  padding: 1rem 1.25rem;
  border-radius: var(--wiz-radius);
  margin-bottom: 0.75rem;
  position: relative;
}
.dependent-row h4, .bds-row h4 {
  margin: 0 0 0.5rem 0;
  color: var(--wiz-midnight);
  font-size: 0.95rem;
}
.dependent-row .remove-btn, .bds-row .remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--wiz-danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* ===== DASHBOARD ===== */
.wiz-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--wiz-text-3);
}
.wiz-loading .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--wiz-border);
  border-top-color: var(--wiz-midnight);
  border-radius: 50%;
  animation: wiz-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes wiz-spin { to { transform: rotate(360deg); } }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.dash-card {
  background: white;
  border: 1px solid var(--wiz-border);
  border-left: 4px solid var(--wiz-midnight);
  border-radius: var(--wiz-radius);
  padding: 1.25rem;
}
.dash-card.gold { border-left-color: var(--wiz-gold); }
.dash-card.success { border-left-color: var(--wiz-success); }
.dash-card.warning { border-left-color: var(--wiz-warning); }
.dash-card.danger { border-left-color: var(--wiz-danger); }
.dash-card .label {
  font-size: 0.75rem;
  color: var(--wiz-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.dash-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wiz-midnight);
}
.dash-card .sub {
  font-size: 0.8rem;
  color: var(--wiz-text-2);
  margin-top: 0.3rem;
}
.dash-section {
  background: white;
  border: 1px solid var(--wiz-border);
  border-radius: var(--wiz-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.dash-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: var(--wiz-midnight);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.dash-table th, .dash-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--wiz-border);
}
.dash-table th {
  color: var(--wiz-text-3);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.dash-bar {
  height: 8px;
  background: var(--wiz-cream);
  border-radius: 4px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--wiz-midnight);
  transition: width 0.6s;
}
.dash-bar-fill.gold { background: var(--wiz-gold); }
.dash-bar-fill.success { background: var(--wiz-success); }
.dash-bar-fill.warning { background: var(--wiz-warning); }
.dash-bar-fill.danger { background: var(--wiz-danger); }

.dash-recommend {
  background: var(--wiz-cream);
  border-left: 4px solid var(--wiz-gold);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--wiz-radius) var(--wiz-radius) 0;
  margin: 1rem 0;
}
.dash-recommend strong { color: var(--wiz-midnight); }
.dash-warn {
  background: #fff4e6;
  border-left: 4px solid var(--wiz-warning);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--wiz-radius) var(--wiz-radius) 0;
  margin: 1rem 0;
}

/* ===== FOOTER ===== */
.wiz-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--wiz-text-3);
  background: white;
  border-top: 1px solid var(--wiz-border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .wiz-container {
    grid-template-columns: 1fr;
  }
  .wiz-sidebar {
    position: relative;
    top: 0;
  }
  .wiz-step-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .wiz-step-list li {
    flex-shrink: 0;
    margin-right: 0.5rem;
    margin-bottom: 0;
  }
  .wiz-step-list li .text-hide-mobile { display: none; }
  .wiz-grid-2 { grid-template-columns: 1fr; }
  .wiz-form-area { padding: 1.5rem 1rem; }
  .wiz-step h1 { font-size: 1.4rem; }
  .wiz-table { font-size: 0.8rem; }
  .wiz-table th, .wiz-table td { padding: 0.4rem 0.5rem; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .wiz-header-inner { padding: 0.75rem 1rem; }
  .wiz-main { padding: 1rem 0.75rem 3rem; }
  .dash-stats { grid-template-columns: 1fr; }
  .wiz-nav { flex-direction: column-reverse; gap: 0.5rem; }
  .wiz-nav .wiz-btn { width: 100%; }
}
