:root {
  --bg: #fff8ef;
  --bg-soft: #fffdf8;
  --milk: #fffaf2;
  --cream: #f7e7d0;
  --caramel: #c58b5c;
  --caramel-soft: #e8c6a6;
  --choco: #3a2418;
  --muted: #8e6d58;
  --pink: #ffd6df;
  --accent: #ff9f68;
  --accent-dark: #e9783f;
  --line: rgba(58, 36, 24, 0.11);
  --shadow: 0 28px 80px rgba(107, 65, 35, 0.15);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --max: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--choco);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 214, 223, 0.65), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 159, 104, 0.28), transparent 26%),
    linear-gradient(180deg, #fff8ef 0%, #fffdf8 42%, #fff8ef 100%);
  min-height: 100vh;
}

a { color: var(--caramel); text-decoration: none; font-weight: 700; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }

.page-shell { position: relative; overflow-x: hidden; }
.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.55;
  pointer-events: none;
}
.page-shell::before {
  width: 300px; height: 300px;
  left: -120px; top: 220px;
  background: rgba(255, 214, 223, 0.65);
}
.page-shell::after {
  width: 240px; height: 240px;
  right: -90px; bottom: 120px;
  background: rgba(255, 179, 125, 0.45);
}

/* --- Header (cabinet only) --- */
.site-header {
  width: min(calc(100% - 32px), var(--max));
  margin: 18px auto 0;
  min-height: 76px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 16px 45px rgba(58, 36, 24, 0.08);
  position: sticky;
  top: 12px;
  z-index: 20;
}
.site-header[hidden] { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand img { height: 44px; width: auto; }
.brand-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--choco);
  color: var(--bg);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-badge-lg { font-size: 12px; padding: 5px 12px; }

.cabinet-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.cabinet-nav button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--choco);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.cabinet-nav button:hover {
  background: rgba(255,255,255,.8);
  border-color: var(--caramel-soft);
}
.nav-logout { color: var(--muted) !important; }

/* --- Layout --- */
.section-pad {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
  padding: 48px 0;
}

.landing-logo {
  width: min(calc(100% - 32px), var(--max));
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 32px;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 32px;
}
.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--caramel);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}
.eyebrow > span:first-child,
.kicker > span:first-child {
  width: 10px; height: 10px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(255, 159, 104, .17);
  flex-shrink: 0;
}
.hero-eyebrow { text-transform: none; letter-spacing: 0; }
.hero-eyebrow-brand {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
  color: var(--caramel);
}
.hero h1 {
  margin: 16px 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .95;
  letter-spacing: -.06em;
  max-width: 680px;
}
.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
  max-width: 580px;
  font-weight: 600;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 22px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  color: var(--choco);
  box-shadow: 0 18px 42px rgba(233, 120, 63, 0.28);
}
.btn-primary:hover { box-shadow: 0 24px 52px rgba(233, 120, 63, 0.34); }
.btn-ghost {
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  color: var(--choco);
}
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 14px; }

.trust-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trust-row span {
  padding: 9px 13px;
  background: rgba(255,255,255,.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-visual {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
.hero-visual img {
  width: min(118%, 720px);
  max-width: none;
  display: block;
  animation: hero-float 6s ease-in-out infinite;
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual { animation: none; }
}

/* --- Sections --- */
.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 32px;
}
.section-heading.compact { max-width: 640px; }
.section-heading h2 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.05em;
}
.section-heading p:not(.kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.feature-card {
  padding: 24px;
  border-radius: 30px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: 0 18px 55px rgba(58, 36, 24, .08);
}
.feature-icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--milk);
  font-size: 26px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.feature-card h3 {
  margin: 16px 0 8px;
  font-size: 20px;
  letter-spacing: -.02em;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 600;
  font-size: 15px;
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.compare-table th {
  font-weight: 900;
  color: var(--choco);
  background: rgba(255,250,242,.8);
}
.compare-table td:first-child { color: var(--muted); }
.compare-highlight {
  background: rgba(255, 214, 223, 0.25);
  color: var(--choco);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.steps article {
  padding: 28px;
  border-radius: 30px;
  min-height: 180px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: 0 18px 55px rgba(58, 36, 24, .08);
}
.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 18px;
  background: var(--choco);
  color: var(--bg);
  font-weight: 950;
}
.steps h3 { margin: 16px 0 8px; font-size: 20px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.6; font-weight: 600; font-size: 15px; }

.final-cta { padding-bottom: 24px; }
.final-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.final-card h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -.04em;
}
.final-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-weight: 600;
  font-size: 17px;
}

.landing-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 40px;
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Auth --- */
.auth-panel {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}
.auth-card {
  width: min(100%, 440px);
  padding: 32px 28px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.auth-back {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}
.auth-logo { margin-bottom: 12px; }
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -.03em;
}
.auth-lead { margin-bottom: 20px; }
.auth-switch {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

/* --- Cabinet --- */
#app {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 8px 0 48px;
}
#app[hidden], #public-shell[hidden] { display: none !important; }

.cabinet-panel h1 {
  margin: 8px 0 20px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.04em;
}

label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--choco);
}
.checkbox-label input { width: auto; margin-top: 3px; }

.billing-balance { font-size: 1.25rem; font-weight: 900; margin: 0 0 8px; }
.price-section-title { margin: 20px 0 10px; font-size: 1.05rem; }
.billing-price-table { margin: 8px 0 16px; font-size: 14px; }
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.package-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}
.package-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(58,36,24,.1); }
.package-card.is-starter { border-color: var(--accent); background: rgba(255,214,223,.35); }
.package-card strong { font-size: 1.05rem; }
.package-card span { color: var(--muted); font-size: .9rem; }
.package-card small { color: var(--caramel); font-size: .75rem; }
.package-card .pkg-tag { color: var(--accent-dark); font-weight: 900; }
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--choco);
  font-weight: 600;
  resize: vertical;
  min-height: 84px;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--choco);
  font-weight: 600;
}
input[type="color"] { height: 44px; padding: 4px; }

.card {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 18px 55px rgba(58, 36, 24, .06);
}
.card h2 { margin: 0 0 12px; font-size: 20px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.tile {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(58, 36, 24, .06);
}
.tile strong { display: block; font-size: 26px; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 700; }

.field-inline { max-width: 360px; }

.preset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.preset-item button {
  flex-shrink: 0;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--choco);
}

.hint { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.big-code {
  display: block;
  font-size: 28px;
  letter-spacing: 3px;
  padding: 16px;
  background: var(--milk);
  border-radius: 14px;
  text-align: center;
  font-weight: 900;
  color: var(--choco);
  border: 1px dashed var(--caramel-soft);
}

.claim-opt summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--caramel);
}
.dash-quick ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.7;
}
.device-steps { margin-bottom: 16px; }

#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--choco);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(58, 36, 24, .25);
}
#toast[hidden] { display: none !important; }

/* --- Chips --- */
.chip-templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.chip-templates button {
  background: rgba(255,255,255,.8);
  border: 1px dashed var(--caramel-soft);
  color: var(--choco);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.chip-group { margin: 16px 0; }
.chip-group-title { font-weight: 900; margin-bottom: 4px; }
.chip-group-hint { color: var(--muted); font-size: 12px; margin-bottom: 8px; font-weight: 700; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-chips button {
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  color: var(--choco);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.prompt-chips button.preset-active {
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  border-color: transparent;
  color: var(--choco);
}
.prompt-preview {
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin: 16px 0;
  font-size: 13px;
}
#prompt-preview-text { color: var(--choco); margin: 8px 0 0; white-space: pre-wrap; font-weight: 600; }

/* --- Branding form --- */
.branding-form fieldset {
  border: none;
  margin: 0 0 24px;
  padding: 0;
}
.branding-section legend {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--choco);
}
.branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 20px;
}
.branding-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}
.branding-grid input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 360px; }
  .hero-visual img { width: min(100%, 520px); }
  .cabinet-nav { width: 100%; }
  .site-header { position: static; }
}

@media (max-width: 520px) {
  .compare-table th, .compare-table td { padding: 12px; font-size: 13px; }
  .auth-card { padding: 24px 18px; }
}
