/* ============================================================
   ValupNow — main.css
   Design tokens: design-system/valupnow/MASTER.md (navy + gold)
   ============================================================ */

:root {
  /* Colors */
  --primary: #0A2540;
  --primary-light: #163A5F;
  --accent: #F2B705;
  --accent-hover: #D9A404;
  --accent-tint: #FFF8E1;
  --alert: #E53935;
  --success: #2E7D32;
  --text-primary: #1A1A1A;
  --text-secondary: #5A6472;
  --text-on-navy: #FFFFFF;
  --text-on-navy-sub: #B8C4D0;
  --bg: #FFFFFF;
  --bg-alt: #F6F8FA;
  --border: #E3E8EE;
  --bg-input: #F6F8FA;

  /* Typography */
  --font-heading: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --gap-xs: 4px; --gap-sm: 8px; --gap-md: 12px; --gap-lg: 16px;
  --gap-xl: 24px; --gap-2xl: 32px; --gap-section: 48px;
  --container-max: 960px;

  /* Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-full: 9999px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap-lg);
}

h1, h2, h3 { font-family: var(--font-heading); }

/* ============ CỤC 1: HERO ============ */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-on-navy);
  padding: var(--gap-xl) 0 var(--gap-section);
  text-align: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-2xl);
}

.hero-logo { width: 32px; height: 32px; color: var(--accent); }

.hero-wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.hero-kicker {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--gap-sm);
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--gap-md);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-on-navy-sub);
  margin-bottom: var(--gap-2xl);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  align-items: center;
}

/* ============ Buttons ============ */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--primary);
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
  min-width: 200px;
  text-decoration: none;
  transition: background 200ms;
  cursor: pointer;
}
.btn-cta:hover { background: var(--accent-hover); }
.btn-cta:focus-visible { outline: 3px solid var(--accent-hover); outline-offset: 2px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-on-navy);
  border: 2px solid currentColor;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  min-height: 48px;
  min-width: 200px;
  text-decoration: none;
  transition: background 200ms;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn-secondary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ============ Sections ============ */
.section { padding: var(--gap-section) 0; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--gap-xl);
  text-align: center;
}

/* ============ CỤC 2: UP ẢNH + AI ============ */
.section-upload { background: var(--bg); }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--gap-xs);
}

.select-type {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 48px;
  cursor: pointer;
}
.select-type:focus-visible { outline: 2px solid var(--accent); }

.note-alert {
  color: var(--alert);
  font-size: 13px;
  font-weight: 500;
  margin-top: var(--gap-sm);
}

.photo-checklist {
  list-style: none;
  margin-top: var(--gap-lg);
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}
.photo-checklist li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
}
.photo-checklist li::before {
  content: '○';
  position: absolute;
  left: 4px;
  color: var(--text-secondary);
}
.photo-checklist li.done { color: var(--success); }
.photo-checklist li.done::before { content: '●'; color: var(--success); }

.upload-zone {
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-2xl) var(--gap-lg);
  text-align: center;
  margin-top: var(--gap-lg);
  transition: border-color 200ms;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); }

.upload-icon { width: 36px; height: 36px; color: var(--text-secondary); margin-bottom: var(--gap-sm); }
.upload-text { font-size: 14px; color: var(--text-secondary); margin-bottom: var(--gap-md); }

.upload-buttons { display: flex; gap: var(--gap-md); justify-content: center; }
.btn-upload {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  transition: border-color 200ms, color 200ms;
  cursor: pointer;
}
.btn-upload:hover { border-color: var(--accent); color: var(--accent-hover); }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--gap-sm);
  margin-top: var(--gap-lg);
}
.preview-item { position: relative; aspect-ratio: 1; }
.preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--alert);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.ocr-status { margin-top: var(--gap-md); font-size: 13px; color: var(--text-secondary); }
.ocr-status.ok { color: var(--success); }

.fields-form {
  margin-top: var(--gap-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
}
.fields-form .field-full { grid-column: 1 / -1; }
.fields-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.fields-form input, .fields-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  min-height: 44px;
}
.fields-form input:focus-visible, .fields-form textarea:focus-visible { outline: 2px solid var(--accent); }

.district-row { margin-top: var(--gap-lg); }

.btn-submit { width: 100%; margin-top: var(--gap-xl); }
.btn-submit[disabled] { opacity: 0.45; cursor: not-allowed; }
.submit-hint {
  margin-top: var(--gap-sm);
  font-size: 13px;
  color: var(--alert);
  text-align: center;
}

.confirm-panel {
  margin-top: var(--gap-xl);
  padding: var(--gap-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  align-items: center;
}
.confirm-title { font-weight: 700; font-size: 17px; color: var(--success); }
.confirm-code-label { font-size: 13px; color: var(--text-secondary); }
.lead-code {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--bg);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 10px 24px;
  cursor: pointer;
}
.confirm-hint { font-size: 13px; color: var(--text-secondary); max-width: 420px; }

/* ============ CỤC 3: 4 BƯỚC ============ */
.section-steps { background: var(--bg-alt); }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl) var(--gap-md);
}

.step { text-align: center; }
.step-number {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-sm);
}
.step-icon { width: 32px; height: 32px; color: var(--primary); display: block; margin: 0 auto var(--gap-sm); }
.step p { font-size: 14px; color: var(--text-secondary); }

/* ============ CỤC 4: CHO TIỆM ============ */
.section-shop {
  background: var(--accent-tint);
  text-align: center;
}
.shop-text {
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto var(--gap-xl);
}
.shop-text strong { color: var(--primary); }

/* ============ Footer + Sticky CTA ============ */
.footer {
  background: var(--primary);
  color: var(--text-on-navy-sub);
  font-size: 13px;
  text-align: center;
  padding: var(--gap-lg) 0;
  padding-bottom: calc(var(--gap-lg) + env(safe-area-inset-bottom));
}

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: var(--gap-sm) var(--gap-lg);
  padding-bottom: calc(var(--gap-sm) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 50;
}
.sticky-cta .btn-cta { width: 100%; }

/* ============ Desktop ============ */
@media (min-width: 768px) {
  .hero-kicker { font-size: 28px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 18px; }
  .hero-actions { flex-direction: row; justify-content: center; }
  .section-title { font-size: 28px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .sticky-cta { display: none; }
}

/* ============ Accessibility ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
