/* ════════════════════════════════════════
   DESIGN TOKENS
   ════════════════════════════════════════ */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f7;
  --color-bg-dark: #1d1d1f;
  --color-text: #1d1d1f;
  --color-secondary: #6e6e73;
  --color-muted: #86868b;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-success: #30d158;
  --color-error: #ff3b30;
  --color-border: #d2d2d7;
  --color-surface: #f5f5f7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;

  --nav-height: 52px;
  --max-w: 1120px;
  --gutter: 24px;
}

/* ════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ════════════════════════════════════════
   LAYOUT UTILITIES
   ════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ════════════════════════════════════════
   NAV
   ════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  transition: color 0.3s;
}

.nav.scrolled .nav-brand { color: var(--color-text); }

.nav-cta {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.2s;
}

.nav.scrolled .nav-cta {
  background: var(--color-accent);
  color: #fff;
}

.nav-cta:hover { opacity: 0.85; }

/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  background: linear-gradient(160deg, #0a0a0b 0%, #1a1a2e 40%, #16213e 70%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 60px) var(--gutter) 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0,113,227,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
  position: relative;
}

.hero-title {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  color: #fff;
  max-width: 820px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(17px, 2.5vw, 22px);
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  line-height: 1.55;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.hero-scroll-indicator svg {
  animation: float 2s ease-in-out infinite;
}

/* ── Hero visual cards ── */
.hero-visual {
  margin-top: 64px;
  position: relative;
  width: 100%;
  max-width: 680px;
}

.hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.hero-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0,113,227,0.3), rgba(0,113,227,0.1));
  border: 1px solid rgba(0,113,227,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.hero-card-label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hero-card-value {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}

.hero-cards-row {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.hero-cards-row .hero-card {
  flex: 1;
  min-width: 0;
}

/* ════════════════════════════════════════
   FEATURES SECTION
   ════════════════════════════════════════ */
.section-features {
  padding: 120px var(--gutter);
  background: var(--color-bg);
}

.section-header {
  text-align: center;
  margin-bottom: 72px;
}

.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.08;
  color: var(--color-text);
  margin-bottom: 18px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--color-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.55;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,113,227,0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover::before { opacity: 1; }

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 24px;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 15px;
  color: var(--color-secondary);
  line-height: 1.6;
}

/* ════════════════════════════════════════
   AUTH SECTION
   ════════════════════════════════════════ */
.section-auth {
  padding: 100px var(--gutter);
  background: linear-gradient(180deg, #f5f5f7 0%, #fff 100%);
}

.auth-wrapper {
  max-width: 460px;
  margin: 0 auto;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.04);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--color-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Form elements ── */
.form-group {
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  appearance: none;
}

.form-input::placeholder { color: #b0b0b5; }

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

.form-input.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}

.form-error {
  font-size: 13px;
  color: var(--color-error);
  margin-top: 6px;
  display: none;
}

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

.form-hint {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 6px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  border: none;
  transition:
    background 0.2s,
    transform 0.1s,
    opacity 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-primary-dark {
  background: var(--color-bg-dark);
  color: #fff;
}
.btn-primary-dark:hover { background: #2d2d2f; }

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}
.btn-outline:hover { background: rgba(0,113,227,0.06); }

.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.2); }

.btn-full { width: 100%; }
.btn-lg { height: 58px; font-size: 17px; padding: 0 30px; }

/* ── OTP inputs ── */
.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.otp-digit {
  height: 58px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  background: var(--color-bg);
  caret-color: var(--color-accent);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--color-muted);
  font-size: 13px;
}

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

/* ── Steps indicator ── */
.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}

.step-dot {
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  transition: all 0.3s;
  flex: 1;
}

.step-dot.active { background: var(--color-accent); }
.step-dot.done { background: var(--color-success); }

/* ════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════ */
.dashboard-layout {
  min-height: 100vh;
  background: var(--color-bg-alt);
}

.dash-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
}

.dash-nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0071e3, #0055b3);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-name {
  font-size: 14px;
  font-weight: 500;
}

.dash-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--gutter);
}

/* ── Stats row ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--color-muted);
  font-weight: 500;
}

/* ── Translator area ── */
.translator-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.translator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.translator-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.badge-coming-soon {
  background: #fff3cd;
  color: #b45309;
}

.badge-live {
  background: #dcfce7;
  color: #166534;
}

.camera-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  position: relative;
  overflow: hidden;
}

.camera-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(0,113,227,0.12) 0%, transparent 70%);
}

.camera-icon {
  font-size: 48px;
  opacity: 0.5;
}

.output-area {
  margin-top: 20px;
  padding: 20px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  min-height: 80px;
}

.output-placeholder {
  font-size: 15px;
  color: var(--color-muted);
  font-style: italic;
}

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
.footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.5);
  padding: 60px var(--gutter) 40px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 13px;
}

/* ════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════ */

/* ── Tablet ── */
@media (min-width: 768px) and (max-width: 1024px) {
  :root { --gutter: 32px; }
  .auth-card { padding: 48px; }
}

/* ── Desktop ── */
@media (min-width: 1025px) {
  :root { --gutter: 40px; }
}

/* ── Mobile only ── */
@media (max-width: 767px) {
  :root { --gutter: 20px; }

  .hero { padding-top: calc(var(--nav-height) + 40px); }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 320px; }

  .hero-cards-row { flex-direction: column; }

  .auth-card { padding: 32px 24px; border-radius: var(--radius-lg); }
  .auth-title { font-size: 24px; }

  .section-features { padding: 80px var(--gutter); }
  .section-auth { padding: 64px var(--gutter); }

  .otp-grid { gap: 8px; }
  .otp-digit { height: 52px; font-size: 20px; }

  .dash-name { display: none; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .translator-card { padding: 24px; }
}

/* ── Small mobile ── */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .otp-grid { gap: 6px; }
  .otp-digit { height: 46px; font-size: 18px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
