/* ============================================================
   ETIKET — Landing Site Stylesheet
   Design tokens ported from lib/core/theme/
   ============================================================ */

/* ── Layer 1: Design Tokens ─────────────────────────────────── */
:root {
  /* Colors — paper & ink */
  --paper:   #FAF6EE;
  --paper2:  #F3ECDD;
  --surface: #FFFFFF;
  --ink:     #1C1814;
  --ink2:    #4A4039;
  --ink3:    #7C7065;
  --ink4:    #B5A99B;
  --bone:    #E8DFCE;
  --bone2:   #EAE2D0;

  /* Brand — Turkish apricot (kayısı) */
  --apricot:       #E8743B;
  --apricot2:      #D3622C;
  --apricot3:      #F39368;
  --apricot-wash:  #FBE6D8;

  /* Nutri-Score A–E */
  --score-a:       #1E8A4C;
  --score-a-wash:  #DFEFE4;
  --score-b:       #7CB342;
  --score-b-wash:  #E8F1D9;
  --score-c:       #F4B73C;
  --score-c-wash:  #FCF1D6;
  --score-d:       #EF7B27;
  --score-d-wash:  #FBE2CD;
  --score-e:       #D63A2F;
  --score-e-wash:  #F7D6D3;

  /* Typography */
  --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* Font sizes (mirrors AppFontSize) */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  40px;
  --text-4xl:  56px;
  --text-5xl:  72px;

  /* Spacing — 8pt grid (mirrors AppSpacing) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  /* Border radius (mirrors AppRadius) */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 999px;

  /* Shadows — warm brown-toned, never cool grey (mirrors AppShadow) */
  --shadow-1: 0 1px 2px rgba(50, 32, 10, 0.06);
  --shadow-2: 0 4px 16px rgba(50, 32, 10, 0.08);
  --shadow-3: 0 16px 48px rgba(50, 32, 10, 0.16);
}

/* ── Layer 2: Reset + Base ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
input { font: inherit; }

/* ── Layer 3: Typography ─────────────────────────────────────── */
.display {
  font-family: var(--font-head);
  font-size: clamp(var(--text-3xl), 8vw, var(--text-5xl));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.h1 {
  font-family: var(--font-head);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.h2 {
  font-family: var(--font-head);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.h3 {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.h4 {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.lead {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink2);
}

.body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
}

.body-sm {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink2);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink3);
}

.caption {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink3);
}

.text-center { text-align: center; }

/* ── Layer 4: Components ─────────────────────────────────────── */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0 var(--s5);
  height: 50px;
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 120ms ease, transform 90ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover   { opacity: 0.88; transform: translateY(-1px); }
.btn:active  { transform: translateY(0) scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary { background: var(--apricot); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(232, 116, 59, 0.35); }

.btn-ink { background: var(--ink); color: var(--paper); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--bone2);
}

.btn-danger {
  background: var(--score-e);
  color: #fff;
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(214, 58, 47, 0.3); }

.btn-sm {
  height: 38px;
  padding: 0 var(--s4);
  font-size: var(--text-sm);
  border-radius: var(--r-sm);
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--bone2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* --- Score Badges --- */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  transition: transform 150ms ease;
}

.score-badge:hover { transform: scale(1.08); }

.score-badge--a { background: var(--score-a); }
.score-badge--b { background: var(--score-b); }
.score-badge--c { background: var(--score-c); color: var(--ink); } /* amber → dark text */
.score-badge--d { background: var(--score-d); }
.score-badge--e { background: var(--score-e); }

.score-badge--lg {
  width: 72px;
  height: 72px;
  font-size: 44px;
  border-radius: var(--r-xl);
}

/* --- Chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  background: var(--paper2);
  color: var(--ink);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 238, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.nav.scrolled {
  border-bottom-color: var(--bone);
  box-shadow: var(--shadow-1);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
}

.nav__brand-text {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.nav__links a:not(.btn) {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink3);
  transition: color 150ms ease;
}

.nav__links a:not(.btn):hover { color: var(--apricot); }

/* --- Step Number --- */
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--apricot);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--text-md);
  flex-shrink: 0;
}

/* --- Legal --- */
.legal-header {
  background: var(--paper2);
  border-bottom: 1px solid var(--bone);
  padding: var(--s8) 0 var(--s7);
}

.legal-header .eyebrow { margin-bottom: var(--s3); }
.legal-header .h1 { margin-bottom: var(--s3); }

.legal-meta {
  font-size: var(--text-sm);
  color: var(--ink3);
}

.legal-body {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s7) var(--s5) var(--s9);
}

.legal-section {
  margin-bottom: var(--s7);
}

.legal-section h2 {
  margin-bottom: var(--s3);
}

.legal-section p,
.legal-section li {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink2);
  margin-bottom: var(--s3);
}

.legal-section ul,
.legal-section ol {
  padding-left: var(--s5);
  list-style: disc;
}

.legal-section ol { list-style: decimal; }
.legal-section li { margin-bottom: var(--s2); }

.link {
  color: var(--apricot);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Callout --- */
.callout {
  background: var(--apricot-wash);
  border-radius: var(--r-xl);
  border-left: 4px solid var(--apricot);
  padding: var(--s5);
}

.callout .h4 { color: var(--apricot2); margin-bottom: var(--s2); }
.callout .body-sm { color: var(--ink2); margin-bottom: 0; }

/* --- Footer --- */
.footer {
  background: var(--paper2);
  border-top: 1px solid var(--bone);
  padding: var(--s7) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.footer__brand-name {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--ink3);
  transition: color 150ms ease;
}

.footer__links a:hover { color: var(--apricot); }

/* ── Layer 5: Layout ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

.section {
  padding: var(--s9) 0;
}

.section--sm {
  padding: var(--s8) 0;
}

.section--alt {
  background: var(--paper2);
}

.section__title {
  margin-top: var(--s3);
  margin-bottom: var(--s7);
}

.grid-2, .grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}

/* ── Layer 6: Animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: none; }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: none; }
}

/* Reveal utility — elements start invisible, animate in on scroll */
.reveal { opacity: 0; }

.reveal.visible {
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

.reveal.scale-in.visible {
  animation-name: scaleIn;
}

.reveal.slide-left.visible {
  animation-name: slideLeft;
}

/* Hero animations — fire on load */
.hero-animate {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

/* Reduced motion — always respect user preference */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.visible,
  .hero-animate {
    animation: none !important;
    opacity: 1 !important;
  }
  * { transition-duration: 0.01ms !important; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .nav__links a:not(.btn) { display: flex; }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Page-specific: Index ───────────────────────────────────── */

/* Hero */
.hero {
  padding: var(--s9) 0;
  background: radial-gradient(ellipse 70% 55% at 90% 110%, var(--apricot-wash), transparent 70%);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s8);
  align-items: center;
}

.hero__eyebrow { margin-bottom: var(--s3); }

.hero__headline {
  margin-bottom: var(--s4);
  color: var(--ink);
}

.hero__sub {
  margin-bottom: var(--s6);
  max-width: 480px;
}

.hero__sub-en {
  display: block;
  margin-top: var(--s2);
  color: var(--ink3);
  font-size: var(--text-base);
  font-style: italic;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* Hero mock phone card */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__phone-mock {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.hero__mock-outer {
  background: var(--surface);
  border-radius: 36px;
  box-shadow: var(--shadow-3), 0 0 0 1px var(--bone2);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.hero__mock-bar {
  height: 5px;
  width: 40%;
  background: var(--bone2);
  border-radius: var(--r-full);
  margin: 0 auto var(--s2);
}

.hero__mock-card {
  padding: var(--s5);
  border-radius: var(--r-xl);
  border: 1px solid var(--bone2);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.hero__mock-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--score-b-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero__mock-content { flex: 1; }

.hero__mock-product {
  font-size: var(--text-xs);
  color: var(--ink3);
  font-weight: 500;
  margin-bottom: var(--s1);
}

.hero__mock-name {
  font-family: var(--font-head);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.hero__mock-card2 {
  padding: var(--s4);
  border-radius: var(--r-lg);
  border: 1px solid var(--bone2);
  background: var(--score-b-wash);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.hero__mock-verdict {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--score-b);
  line-height: 1;
}

.hero__mock-verdict-label {
  font-size: var(--text-xs);
  color: var(--ink3);
  font-weight: 500;
}

/* Steps section */
.steps { margin-top: var(--s7); }

.step {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--bone2);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.step__title { margin-top: var(--s2); }

/* Nutri-score section */
.nutriscore__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s8);
  align-items: center;
}

.nutriscore__text .eyebrow { margin-bottom: var(--s3); }
.nutriscore__text .h2 { margin-bottom: var(--s4); }

.nutriscore__strip {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  padding-bottom: var(--s2);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nutriscore__strip::-webkit-scrollbar { display: none; }

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  scroll-snap-align: start;
  flex-shrink: 0;
  text-align: center;
  min-width: 88px;
}

.score-item .h4 { font-size: var(--text-sm); }
.score-item .caption { font-size: 10px; color: var(--ink4); max-width: 80px; }

/* Features grid */
.features { margin-top: var(--s7); }

.feature-card {
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--apricot-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* CTA section */
.cta-section {
  background: var(--ink);
  padding: var(--s9) 0;
}

.cta-section__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.cta-section .h1,
.cta-section .display {
  color: var(--paper);
}

.cta-section .lead {
  color: var(--ink4);
}

.cta-section__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s2);
}

.cta-section .btn-ghost {
  color: var(--paper);
  border-color: rgba(250, 246, 238, 0.25);
}

.cta-section .btn-ghost:hover {
  background: rgba(250, 246, 238, 0.08);
}

/* ── Page-specific: Delete Account ─────────────────────────── */
.delete-states > div { display: none; }
.delete-states > div.active { display: block; }

.delete-form {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  max-width: 420px;
}

.input-field {
  width: 100%;
  height: 50px;
  padding: 0 var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--bone2);
  background: var(--surface);
  font-size: var(--text-base);
  color: var(--ink);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-field::placeholder { color: var(--ink4); }

.input-field:focus {
  border-color: var(--apricot);
  box-shadow: 0 0 0 3px rgba(232, 116, 59, 0.15);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink2);
  display: block;
  margin-bottom: var(--s1);
}

.error-msg {
  font-size: var(--text-sm);
  color: var(--score-e);
  display: none;
  margin-top: var(--s1);
}

.error-msg.visible { display: block; }

.delete-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--s5);
}

.delete-step {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--bone);
}

.delete-step:last-child { border-bottom: none; }

.delete-step__content { flex: 1; }
.delete-step__content .h4 { margin-bottom: var(--s1); }

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--paper2);
  border: 1px solid var(--bone2);
  border-radius: var(--r-full);
  padding: var(--s2) var(--s4);
  font-size: var(--text-sm);
  color: var(--ink2);
  font-weight: 500;
  margin-bottom: var(--s5);
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s5);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--score-a-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s5);
}

.success-icon svg { color: var(--score-a); }

/* State: checking (loading spinner) */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bone2);
  border-top-color: var(--apricot);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: var(--s7) auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  text-align: center;
  padding: var(--s8) 0;
}

/* ── Responsive breakpoints ─────────────────────────────────── */
@media (min-width: 640px) {
  .hero__cta { flex-wrap: nowrap; }

  .nav__links a:not(.btn) { display: flex; }

  .confirm-actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 639px) {
  .nav__links a:not(.btn) { display: none; }
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s9);
  }

  .hero__sub { max-width: 520px; }

  .nutriscore__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s8);
  }

  .nutriscore__strip {
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}
