/* ─────────────────────────────────────────────
   회생파산지원보호센터 · 개인회생 자가진단
   Design System
   ───────────────────────────────────────────── */

:root {
  /* Color tokens */
  --navy-950: #0a1220;
  --navy-900: #0f1a2e;
  --navy-800: #182544;
  --navy-700: #22355f;
  --navy-500: #3b5788;
  --navy-400: #6b7fa3;

  --gold-700: #a8895a;
  --gold-600: #c9a96e;
  --gold-500: #d4b887;
  --gold-300: #e8d5ab;
  --gold-100: #f5ebd6;

  --cream-50:  #faf8f4;
  --cream-100: #f4efe5;
  --cream-200: #ebe3d1;

  --ink-900: #1a1f2e;
  --ink-700: #3d4761;
  --ink-500: #6b7489;
  --ink-400: #8b92a5;
  --ink-300: #b8bcc8;
  --ink-200: #d8dbe3;
  --ink-100: #ebedf2;
  --ink-50:  #f7f8fa;

  --success: #2d8a54;
  --warn:    #b78230;
  --danger:  #b94343;

  /* Typography */
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  --font-sans:  'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 26, 46, 0.06), 0 1px 3px rgba(15, 26, 46, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 26, 46, 0.08), 0 2px 6px rgba(15, 26, 46, 0.05);
  --shadow-lg: 0 12px 32px -8px rgba(15, 26, 46, 0.14), 0 4px 12px rgba(15, 26, 46, 0.06);
  --shadow-xl: 0 24px 56px -12px rgba(15, 26, 46, 0.2), 0 8px 20px rgba(15, 26, 46, 0.08);
  --shadow-gold: 0 8px 24px -8px rgba(201, 169, 110, 0.4);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 520ms;

  /* Container */
  --container: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--cream-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy-900);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}
p { margin: 0; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { display: block; max-width: 100%; }

/* ── Layout ──────────────────────────────────── */

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

.section {
  padding: clamp(60px, 9vw, 120px) 0;
}

/* ── Nav ─────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream-50);          /* WebView 호환성: solid fallback 우선 */
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 26, 46, 0.06);
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
.nav-inner { min-width: 0; }
.brand { min-width: 0; flex-shrink: 1; }
.nav-inner > div { min-width: 0; flex-shrink: 1; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--navy-900);
  color: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 16px; }
.brand-name small {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy-900);
  color: var(--cream-50);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease);
}
.nav-cta:hover { background: var(--navy-800); transform: translateY(-1px); }

/* ── Hero ────────────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(64px, 10vw, 128px) 0 clamp(48px, 8vw, 96px);
  background:
    radial-gradient(ellipse at 15% 10%, rgba(201, 169, 110, 0.14), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(59, 87, 136, 0.10), transparent 60%),
    linear-gradient(180deg, #0a1220 0%, #0f1a2e 60%, #182544 100%);
  color: var(--cream-50);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(201, 169, 110, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 110, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-300);
  font-weight: 600;
}
.eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--gold-500);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.24);
}

.hero h1 {
  color: var(--cream-50);
  font-size: clamp(34px, 5.2vw, 58px);
  font-weight: 800;
  margin-top: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero h1 .accent {
  color: var(--gold-500);
  font-style: italic;
  font-weight: 700;
}
.hero p.lead {
  margin-top: 22px;
  color: rgba(245, 235, 214, 0.78);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 520px;
  line-height: 1.75;
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--dur) var(--ease);
  will-change: transform;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--navy-950);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -10px rgba(201, 169, 110, 0.55); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  border: 1px solid rgba(245, 235, 214, 0.26);
  color: var(--cream-50);
}
.btn-ghost:hover { background: rgba(245, 235, 214, 0.08); border-color: rgba(245, 235, 214, 0.4); }

.btn-dark {
  background: var(--navy-900);
  color: var(--cream-50);
}
.btn-dark:hover { background: var(--navy-800); transform: translateY(-1px); }

.btn-outline {
  border: 1px solid var(--ink-200);
  color: var(--navy-900);
  background: #fff;
}
.btn-outline:hover { border-color: var(--navy-900); }

/* Hero card */
.hero-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(245, 235, 214, 0.12);
  border-radius: var(--r-xl);
  padding: 36px;
  backdrop-filter: blur(10px);
}
.hero-card h3 {
  color: var(--gold-300);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.stat .num {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  color: var(--cream-50);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat .num sup { font-size: 0.5em; color: var(--gold-500); }
.stat .lab {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(245, 235, 214, 0.66);
  letter-spacing: 0.01em;
}
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.45), transparent);
  margin: 28px 0 24px;
}
.hero-card ul.checks {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 10px;
}
.hero-card ul.checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(245, 235, 214, 0.86);
}
.hero-card ul.checks li::before {
  content: "";
  width: 18px; height: 18px;
  background: var(--gold-500);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='m9 16.17-3.88-3.88a1 1 0 0 0-1.41 1.41l4.59 4.59a1 1 0 0 0 1.41 0L20.29 7.71a1 1 0 0 0-1.41-1.41Z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='m9 16.17-3.88-3.88a1 1 0 0 0-1.41 1.41l4.59 4.59a1 1 0 0 0 1.41 0L20.29 7.71a1 1 0 0 0-1.41-1.41Z'/></svg>") center/contain no-repeat;
  flex: none;
}

/* ── Generic sections ────────────────────────── */

.section-title {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.section-title .eyebrow-light {
  color: var(--gold-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section-title h2 {
  font-size: clamp(24px, 3.6vw, 42px);
  margin-top: 12px;
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.section-title p {
  margin-top: 16px;
  color: var(--ink-500);
  font-size: 16px;
  line-height: 1.7;
}

/* ── How it works ────────────────────────────── */

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .how-grid { grid-template-columns: 1fr; } }

.how-card {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 28px;
  position: relative;
  transition: all var(--dur) var(--ease);
}
.how-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.how-card .step {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-700);
  letter-spacing: 0.1em;
}
.how-card h3 {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 700;
}
.how-card p {
  margin-top: 10px;
  color: var(--ink-500);
  font-size: 14px;
  line-height: 1.7;
}

/* ── Diagnose flow ───────────────────────────── */

.diag-shell {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.diag-progress {
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--ink-100);
  background: linear-gradient(180deg, #fff, var(--cream-50));
}
.diag-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.diag-progress-row .step-label {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--navy-900);
  font-size: 15px;
}
.diag-progress-row .step-count {
  font-size: 13px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 4px;
  background: var(--ink-100);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-700));
  border-radius: 99px;
  transition: width var(--dur-slow) var(--ease-out);
}

.diag-body { padding: clamp(28px, 4vw, 48px); }

.question-label {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.question-help {
  margin-top: 10px;
  color: var(--ink-500);
  font-size: 14px;
  line-height: 1.7;
}

.options {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--ink-100);
  border-radius: var(--r-md);
  background: #fff;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.option:hover { border-color: var(--gold-500); background: var(--cream-50); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .bullet {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink-300);
  display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease);
}
.option .bullet::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-600);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease);
}
.option input:checked ~ .bullet { border-color: var(--gold-600); }
.option input:checked ~ .bullet::after { transform: scale(1); }
.option:has(input:checked) {
  border-color: var(--gold-600);
  background: linear-gradient(180deg, #fffbf3, var(--cream-100));
  box-shadow: 0 6px 20px -8px rgba(201, 169, 110, 0.35);
}
.option .label { font-size: 15px; font-weight: 500; color: var(--navy-900); }

.diag-nav {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ── Result ──────────────────────────────────── */

.result-shell {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.result-hero {
  background: radial-gradient(ellipse at top right, rgba(201, 169, 110, 0.2), transparent 60%), var(--navy-900);
  color: var(--cream-50);
  padding: clamp(36px, 5vw, 60px);
  text-align: center;
  position: relative;
}
.grade-badge {
  width: 140px; height: 140px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--gold-500), var(--gold-700), var(--gold-500));
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 20px 50px -20px rgba(201, 169, 110, 0.6);
}
.grade-badge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--navy-950);
}
.grade-badge span {
  position: relative;
  font-family: var(--font-serif);
  font-size: 66px;
  font-weight: 900;
  color: var(--gold-500);
  letter-spacing: -0.02em;
}
.grade-badge[data-grade="A"] span { color: var(--gold-500); }
.grade-badge[data-grade="B"] span { color: var(--gold-300); }
.grade-badge[data-grade="C"] span { color: #8bb3d6; }
.grade-badge[data-grade="D"] span { color: #e8a977; }
.grade-badge[data-grade="E"] span { color: #d49595; }
.grade-badge[data-grade="F"] span { color: #b94343; }

.result-hero .result-label {
  color: var(--gold-300);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}
.result-hero h2 {
  color: var(--cream-50);
  font-size: clamp(28px, 3.6vw, 36px);
  margin-top: 10px;
}
.result-hero .score-line {
  margin-top: 16px;
  font-size: 15px;
  color: rgba(245, 235, 214, 0.7);
}
.result-hero .score-line strong {
  color: var(--gold-500);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
}
.result-body {
  padding: clamp(28px, 4vw, 48px);
}
.result-message {
  background: var(--cream-50);
  border-left: 3px solid var(--gold-500);
  padding: 20px 24px;
  border-radius: 4px;
  color: var(--navy-900);
  font-size: 15px;
  line-height: 1.8;
}
.result-message.warn {
  background: #fff5ed;
  border-left-color: var(--warn);
}
.result-message.danger {
  background: #fdf3f3;
  border-left-color: var(--danger);
}
.disqualify-list {
  margin-top: 14px;
  padding: 0; list-style: none;
  display: grid; gap: 8px;
  font-size: 14px;
  color: var(--ink-700);
}
.disqualify-list li::before { content: "• "; color: var(--danger); }

.breakdown {
  margin-top: 32px;
  border-top: 1px solid var(--ink-100);
  padding-top: 24px;
}
.breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 14px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink-100);
  font-size: 14px;
}
.breakdown-row .q { color: var(--ink-700); flex: 1; }
.breakdown-row .a { color: var(--navy-900); font-weight: 500; }
.breakdown-row .s { color: var(--gold-700); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }

/* ── Consult form ────────────────────────────── */

.consult-form {
  margin-top: 32px;
  background: linear-gradient(180deg, var(--cream-50), #fff);
  border: 1px solid var(--cream-200);
  border-radius: var(--r-lg);
  padding: clamp(24px, 3vw, 36px);
}
.consult-form h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 6px;
}
.consult-form > p {
  color: var(--ink-500); font-size: 14px; margin-bottom: 20px;
}
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 13px;
  color: var(--ink-700);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field input, .field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 15px;
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:focus, .field textarea:focus {
  border-color: var(--gold-600);
  outline: none;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.privacy {
  display: flex; align-items: flex-start;
  gap: 10px;
  font-size: 13px; color: var(--ink-500);
  line-height: 1.7;
  margin: 10px 0 18px;
}
.privacy input { margin-top: 3px; }

/* ── Firm card ───────────────────────────────── */

.firm-card {
  background: var(--navy-900);
  color: var(--cream-50);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 44px);
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(201, 169, 110, 0.14), transparent 50%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  position: relative;
  overflow: hidden;
}
.firm-card::after {
  content: "⚖";
  position: absolute;
  right: -10px; bottom: -20px;
  font-size: 220px;
  color: rgba(201, 169, 110, 0.04);
  pointer-events: none;
}
.firm-card h3 {
  color: var(--gold-300);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.firm-card .firm-name {
  margin-top: 10px;
  color: var(--cream-50);
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
}
.firm-card .firm-attr {
  margin-top: 6px;
  color: var(--gold-500);
  font-size: 15px;
}
.firm-info {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 32px;
}
@media (max-width: 520px) { .firm-info { grid-template-columns: 1fr; } }
.firm-info dt {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 235, 214, 0.45);
  font-weight: 600;
}
.firm-info dd {
  margin: 6px 0 0;
  font-size: 15px;
  color: rgba(245, 235, 214, 0.9);
}
.firm-info dd a { color: var(--gold-500); font-weight: 600; }

/* ── Footer ──────────────────────────────────── */

.footer {
  background: var(--navy-950);
  color: rgba(245, 235, 214, 0.5);
  padding: 48px 0 calc(40px + env(safe-area-inset-bottom, 0));
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  font-size: 13px;
  line-height: 1.7;
}

/* 모바일 — 메인 콘텐츠가 없는 페이지는 기본 하단 여백만 */
main { padding-bottom: env(safe-area-inset-bottom, 0); }
.footer .container { display: grid; gap: 18px; }
.footer strong { color: var(--cream-50); font-weight: 600; }
.footer .disclaimer {
  padding: 16px;
  background: rgba(245, 235, 214, 0.03);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: rgba(245, 235, 214, 0.4);
}

/* ── Motion ──────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp var(--dur-slow) var(--ease-out) both; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── Utility ─────────────────────────────────── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ── Reduced motion ──────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ─── Mobile optimization (≤ 640px) ─────────────── */
@media (max-width: 640px) {
  /* iOS 자동 확대 방지 */
  input, select, textarea { font-size: 16px !important; }

  .container { padding: 0 16px; }
  .section { padding: 48px 0; }

  /* 메인 nav - 보조 링크 숨김, 브랜드 작게 */
  .nav-inner { height: 60px; gap: 8px; }
  .brand-name { font-size: 14px; }
  .brand-name small { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 15px; }
  .nav-inner > div > a:not(.nav-cta):not(.auth-link):not(.auth-register) { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 13px; }
  .auth-login, .auth-logout { display: none !important; }
  .auth-menu { gap: 6px; }
  .auth-name { display: none; }

  /* Hero */
  .hero { padding: 48px 0 40px; }
  .hero-inner { gap: 28px; }
  .hero-card { padding: 24px; }
  .hero-stats { gap: 18px; }
  .btn { padding: 13px 22px; font-size: 14px; }

  /* Section titles */
  .section-title { margin-bottom: 40px; }

  /* Firm card & how */
  .how-card, .firm-card { padding: 24px; }

  /* 진단 */
  .diag-shell { border-radius: 14px; }
  .diag-progress { padding: 18px 20px 14px; }
  .diag-body { padding: 24px 20px; }
  .question-label { font-size: 20px; }
  .option { padding: 14px 16px; }
  .diag-nav { flex-direction: column-reverse; gap: 10px; }
  .diag-nav .btn { width: 100%; }

  /* 결과 페이지 */
  .result-hero { padding: 32px 20px; }
  .result-body { padding: 24px 20px; }
  .grade-badge { width: 110px; height: 110px; }
  .grade-badge span { font-size: 50px; }
  .breakdown-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 0; }
  .breakdown-row .q { font-size: 13px; }
  .breakdown-row .a { font-weight: 600; }

  /* 상담 폼 */
  .consult-form { padding: 22px 20px; }
  .field input, .field textarea { padding: 13px 12px; }

  /* 모달 */
  .modal-backdrop { padding: 16px; }
  .modal { max-height: 90vh; }
  .modal-head { padding: 16px 18px; }
  .modal-body { padding: 20px 18px; }
  .detail-row { grid-template-columns: 110px 1fr; gap: 10px; font-size: 13px; }

  /* Footer */
  .footer { padding: 32px 0 24px; font-size: 12.5px; }
}

/* ─── Small mobile (≤ 380px) ─────────────────── */
@media (max-width: 380px) {
  .brand-name { font-size: 13px; }
  .nav-cta { padding: 7px 12px; font-size: 12px; }
  .hero h1 { font-size: 30px; }
}

/* ═══════════════════════════════════════════════
   APP MODE — Capacitor 네이티브 셸 (body.app-mode)
   상단 컴팩트 nav · 햄버거 시트 · 하단 탭바
   ─────────────────────────────────────────────── */

/* ── 햄버거 버튼 (모든 nav에 주입) ─────────────── */
.app-burger {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--navy-900);
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-burger:active { background: rgba(15,26,46,0.08); }
.dark-nav .app-burger,
.lp-topbar .app-burger { color: var(--cream-50); }
.dark-nav .app-burger:active,
.lp-topbar .app-burger:active { background: rgba(245,235,214,0.1); }

body.app-mode .app-burger { display: inline-flex; }

/* ── 앱 모드: 상단 nav 컴팩트화, 부가 메뉴 숨김 ── */
body.app-mode .nav-inner,
body.app-mode .lp-topbar-inner,
body.app-mode .my-nav-inner {
  height: 56px;
  gap: 8px;
}
body.app-mode .nav-inner > *:not(.brand):not(.app-burger),
body.app-mode .lp-topbar-inner > *:not(.brand):not(.app-burger),
body.app-mode .my-nav-inner > *:not(.brand):not(.app-burger) {
  display: none !important;
}
body.app-mode .nav-cta { display: none !important; }
body.app-mode .lp-topbar-phone,
body.app-mode .lp-topbar-cta { display: none !important; }
body.app-mode #auth-slot { display: none !important; }
body.app-mode .brand-name { font-size: 15px; }
body.app-mode .brand-name small { display: none; }

/* nav-inner를 양 끝 정렬로 고정 (브랜드 좌, 햄버거 우) */
body.app-mode .nav-inner,
body.app-mode .lp-topbar-inner,
body.app-mode .my-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── 시트 (햄버거 메뉴) ──────────────────────── */
.app-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  visibility: hidden;
  pointer-events: none;
}
.app-sheet.open { visibility: visible; pointer-events: auto; }
.app-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,26,46,0.55);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
.app-sheet.open .app-sheet-backdrop { opacity: 1; }
.app-sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(86%, 360px);
  height: 100%;
  background: var(--cream-50);
  box-shadow: -16px 0 40px rgba(15,26,46,0.18);
  transform: translateX(100%);
  transition: transform 280ms var(--ease-out);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: hidden;
}
.app-sheet.open .app-sheet-panel { transform: translateX(0); }
.app-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-100);
}
.app-sheet-head .brand { display: flex; align-items: center; }
.app-sheet-close {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-500);
  background: transparent;
  border: none;
}
.app-sheet-close:active { background: rgba(15,26,46,0.06); color: var(--navy-900); }

.app-sheet-auth { padding: 16px 18px 0; }
.app-sheet-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: 14px;
  margin-bottom: 4px;
}
.app-sheet-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--navy-950);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 17px;
}
.app-sheet-username { font-size: 14px; font-weight: 700; color: var(--navy-900); }
.app-sheet-email { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.app-sheet-logout {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--ink-200);
  background: transparent;
  border-radius: 999px;
  color: var(--ink-700);
}
.app-sheet-cta-outline,
.app-sheet-cta {
  flex: 1;
  text-align: center;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--ink-200);
  color: var(--navy-900);
  background: #fff;
}
.app-sheet-cta {
  background: var(--navy-900);
  color: var(--cream-50);
  border-color: var(--navy-900);
}

.app-sheet-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 20px;
}
.app-sheet-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-900);
  border-radius: 12px;
  transition: background 120ms var(--ease);
}
.app-sheet-nav a:active { background: rgba(15,26,46,0.06); }
.app-sheet-nav a svg { color: var(--gold-700); flex-shrink: 0; }
.app-sheet-divider {
  height: 1px;
  background: var(--ink-100);
  margin: 10px 12px;
}
.app-sheet-foot {
  padding: 14px 22px 18px;
  font-size: 11.5px;
  color: var(--ink-400);
  line-height: 1.7;
  border-top: 1px solid var(--ink-100);
  background: #fff;
}
.app-sheet-foot strong { color: var(--ink-700); }

/* ── 하단 탭바 ──────────────────────────────── */
.app-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(250, 248, 244, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--ink-100);
  z-index: 9000;
  align-items: stretch;
  justify-content: space-around;
}
body.app-mode .app-tabbar { display: flex; }
.app-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-400);
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms var(--ease);
}
.app-tab svg { color: inherit; }
.app-tab.active { color: var(--navy-900); }
.app-tab:active { color: var(--gold-700); }

/* 가운데 전화 — 강조 원형 (FAB 스타일) */
.app-tab-call {
  position: relative;
  color: var(--cream-50);
  font-weight: 700;
}
.app-tab-call .app-tab-call-bg {
  position: absolute;
  top: -16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  color: var(--navy-950);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(168, 137, 90, 0.4), 0 2px 6px rgba(15,26,46,0.18);
}
.app-tab-call span:last-child {
  margin-top: 38px;
  color: var(--navy-900);
}
.app-tab-call:active .app-tab-call-bg { transform: scale(0.94); transition: transform 120ms; }

/* ── 앱 모드: 푸터 숨김 + body 하단 패딩 (탭바 공간) ── */
body.app-mode .footer { display: none; }
body.app-mode {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
}
/* 모바일 sticky CTA가 있는 LP는 탭바와 충돌 → 앱 모드에서 LP sticky CTA 숨김 */
body.app-mode .lp-mobile-cta { display: none !important; }

/* ── 안전영역(상단) — 앱 모드에서 nav가 status bar와 자연스럽게 ── */
body.app-mode .nav,
body.app-mode .lp-topbar,
body.app-mode .my-nav {
  padding-top: env(safe-area-inset-top, 0);
}

