/* Shared application chrome: auth, buy flow, customer, admin. */
:root {
  --app-bg: #F3F1EC;
  --app-ink: #121418;
  --app-card: #FFFcf8;
  --app-line: #E4DFD6;
  --app-muted: #6F6A62;
  --app-accent: #D6F25C;
  --app-accent-ink: #15180A;
  --sidebar: 248px;
}
body.app {
  background: var(--app-bg);
  color: var(--app-ink);
  min-height: 100vh;
}
body.app a { color: inherit; }
body.app a.btn-ink { background: #121418; color: #F4F1EA; }
body.app a.btn-lime, body.app a.btn-portal { background: #D6F25C; color: #15180A; }
body.app a.btn-ghost { color: #121418; background: transparent; }
body.app .kicker { color: #5E6A16; }

.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--app-bg); color: var(--app-ink);
}
.auth-aside {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 420px at 88% 108%, rgba(214, 242, 92, 0.16), transparent 70%),
    #101114;
  color: #F4F2EE;
  padding: 40px 52px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.auth-brand { color: #F4F2EE; position: relative; z-index: 1; }
.auth-brand svg { width: 26px; height: 26px; }
.auth-aside-copy { position: relative; z-index: 1; }
body.app .auth-aside .kicker { color: var(--lime); }
.auth-aside h2 {
  font-size: clamp(40px, 3.7vw, 56px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  max-width: 100%;
  margin-top: 14px;
}
.auth-aside h2 span { display: block; white-space: nowrap; }
.auth-note {
  position: relative;
  z-index: 1;
  max-width: 340px;
  color: #A39E94;
  font-size: 15px;
}
.auth-main { display: grid; place-items: center; padding: 40px 28px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 40px; letter-spacing: -0.04em; margin-bottom: 8px; }
.auth-card .sub { color: var(--app-muted); margin-bottom: 26px; }
.auth-card .btn-block { margin-top: 8px; padding: 13px 18px; }
.auth-card .help a { border-bottom: 1px solid transparent; }
.auth-card .help a:hover { border-bottom-color: currentColor; }
.auth-brand,
.auth-note { animation: auth-in 1s cubic-bezier(.16, 1, .3, 1) both; }
.auth-note { animation-delay: .62s; }
.auth-aside h2 span {
  animation: auth-line 1.05s cubic-bezier(.16, 1, .3, 1) both;
}
.auth-aside h2 span:nth-child(1) { animation-delay: .12s; }
.auth-aside h2 span:nth-child(2) { animation-delay: .24s; }
.auth-aside h2 span:nth-child(3) { animation-delay: .36s; }
body.app .auth-aside .kicker { animation: auth-in 1s cubic-bezier(.16, 1, .3, 1) .08s both; }
.auth-card > * { animation: auth-rise .95s cubic-bezier(.16, 1, .3, 1) both; }
.auth-card > *:nth-child(1) { animation-delay: .16s; }
.auth-card > *:nth-child(2) { animation-delay: .26s; }
.auth-card > *:nth-child(3) { animation-delay: .36s; }
.auth-card > *:nth-child(4) { animation-delay: .46s; }
.auth-card > *:nth-child(5) { animation-delay: .56s; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--app-muted); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--app-line); background: white; border-radius: 12px; padding: 13px 14px; color: var(--app-ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #121418;
  box-shadow: 0 0 0 4px rgba(18, 20, 24, 0.06);
}
.field textarea { min-height: 110px; resize: vertical; }
.help { color: var(--app-muted); font-size: 13px; }
.error-text { color: #A33B32; font-size: 14px; margin-bottom: 10px; }
.steps-bar { display: flex; gap: 6px; margin: 18px 0; }
.steps-bar span { height: 4px; flex: 1; border-radius: 99px; background: var(--app-line); }
.steps-bar span.on { background: var(--app-ink); }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side {
  background: #101114; color: #F4F2EE; padding: 18px 12px 24px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column;
}
.side a.nav-item {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px;
  color: #B7B2A8; font-size: 14px;
}
.side a.nav-item svg { width: 16px; height: 16px; }
.side a.nav-item.active, .side a.nav-item:hover { background: #1C1E24; color: white; }
.side .brand { padding: 8px 12px 18px; }
.side-foot { margin-top: auto; padding: 12px; color: #8E897F; font-size: 13px; }
.main { padding: 28px 32px 64px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 32px; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.top-actions .btn, .studio-head .btn { white-space: nowrap; }
.menu-btn { display: none; }

.grid-4, .grid-3, .grid-2 { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.card {
  background: var(--app-card); border: 1px solid var(--app-line); border-radius: 18px; padding: 18px;
}
.card h3 { font-size: 15px; font-family: var(--sans); letter-spacing: 0; font-weight: 600; color: var(--app-muted); }
.metric { font-family: var(--display); font-size: 32px; letter-spacing: -0.04em; margin-top: 8px; }
.progress { height: 8px; background: #ECE7DE; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; background: #121418; }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px;
  font-size: 12px; background: #F0EBE3; color: #3C3A34; border: 1px solid var(--app-line);
}
.badge.ok { background: #E7F6C8; }
.badge.warn { background: #F8E7C8; }
.badge.bad { background: #F8D9D4; }
.table-wrap { overflow: auto; border: 1px solid var(--app-line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--app-line); vertical-align: top; }
th { font-size: 12px; color: var(--app-muted); font-weight: 600; }
.empty { padding: 36px 8px; text-align: left; }
.empty h3 { font-size: 24px; color: var(--app-ink); margin-bottom: 6px; }
.empty p { color: var(--app-muted); margin-bottom: 14px; max-width: 460px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row-form .field { margin: 0; min-width: 140px; flex: 1; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--app-ink); }

.buy-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; }
.wizard { display: grid; grid-template-columns: 1fr 420px; min-height: calc(100vh - 68px); }
.wizard-main { padding: 12px 32px 48px; }
.wizard-side { border-left: 1px solid var(--app-line); padding: 18px; background: #fff; position: sticky; top: 0; height: 100vh; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice {
  border: 1px solid var(--app-line); background: white; border-radius: 16px; padding: 16px; text-align: left; cursor: pointer;
}
.choice.is-on { border-color: #121418; box-shadow: inset 0 0 0 1px #121418; }
.choice strong { display: block; font-size: 18px; }
.choice span { color: var(--app-muted); font-size: 13px; }
.phone-frame {
  width: 260px; height: 520px; margin: 12px auto; border-radius: 36px; border: 10px solid #1A1C21;
  overflow: hidden; background: #000;
}
.phone-frame iframe, .browser-frame iframe { width: 100%; height: 100%; border: 0; }
.browser-frame { height: 240px; border: 1px solid var(--app-line); border-radius: 12px; overflow: hidden; background: white; }
.device-toggle { display: flex; gap: 6px; margin-bottom: 8px; }
.hidden { display: none !important; }
.quote-line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: var(--app-muted); }
.quote-line.total { color: var(--app-ink); font-weight: 650; border-top: 1px solid var(--app-line); margin-top: 6px; padding-top: 10px; }

.builder {
  height: 100vh; display: grid; grid-template-columns: 260px 1fr 300px; background: #ECE8E1; color: var(--app-ink);
}
.builder aside, .builder .inspector { background: #fff; overflow: auto; }
.builder .canvas { display: flex; flex-direction: column; min-width: 0; }
.builder header.b-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; gap: 8px; }
.builder iframe { flex: 1; width: 100%; border: 0; background: white; }
.builder .frame { flex: 1; display: flex; justify-content: center; padding: 8px; min-height: 0; }
.builder .frame.desktop iframe { width: 100%; }
.builder .frame.tablet iframe { width: 820px; border: 1px solid var(--app-line); border-radius: 12px; }
.builder .frame.mobile iframe { width: 390px; border: 1px solid var(--app-line); border-radius: 16px; }
.b-list button, .sec-item {
  width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--app-line);
  padding: 10px 12px; cursor: pointer;
}
.sec-item.is-on { background: #F6F3EC; }
.sec-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.inspector { padding: 14px; border-left: 1px solid var(--app-line); }
.save-state { font-size: 12px; color: var(--app-muted); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.timeline i {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #121418; margin-top: 4px; background: transparent;
}
.timeline li.done i { background: #121418; }
.timeline li.current i { background: var(--app-accent); }
.timeline .body { border-inline-start: 1px solid var(--app-line); margin-inline-start: -22px; padding: 0 0 18px 22px; }

@keyframes auth-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes auth-line {
  from { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes auth-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand, .auth-note, .auth-aside h2 span, .auth-aside .kicker, .auth-card > * {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@media (max-width: 980px) {
  .topbar h1 { font-size: 26px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; transform: translateX(-105%); transition: transform .2s ease; width: min(84vw, 300px); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 14px 48px; }
  .grid-4, .grid-3, .grid-2, .choice-grid, .wizard { grid-template-columns: 1fr; }
  .wizard-side { position: relative; height: auto; border-left: 0; border-top: 1px solid var(--app-line); }
  .builder { grid-template-columns: 1fr; height: auto; }
  .builder .inspector { border-left: 0; border-top: 1px solid var(--app-line); }
}
