:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #132238;
  --muted: #66758a;
  --line: #dfe7f1;
  --brand: #2367f2;
  --brand-deep: #174ab6;
  --brand-soft: #e9f0ff;
  --success: #138a5b;
  --success-soft: #e7f8f0;
  --warning: #ad6b08;
  --warning-soft: #fff4d9;
  --danger: #c53b48;
  --danger-soft: #ffebee;
  --shadow: 0 22px 70px rgba(28, 57, 99, 0.12);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(35, 103, 242, 0.15), transparent 28rem),
    radial-gradient(circle at 95% 15%, rgba(66, 196, 172, 0.13), transparent 24rem),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 55%, #eef3f9 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #4c84ff, #1855d4);
  box-shadow: 0 10px 26px rgba(35, 103, 242, 0.3);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }

.secure-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 700;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(19,138,91,.12); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy, .card {
  border: 1px solid rgba(211, 223, 238, 0.92);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy { padding: clamp(28px, 5vw, 54px); overflow: hidden; position: relative; }
.hero-copy::after {
  position: absolute;
  width: 230px;
  height: 230px;
  right: -85px;
  bottom: -105px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(35,103,242,.18), rgba(66,196,172,.12));
  content: "";
}

.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 660px; margin: 13px 0 14px; font-size: clamp(32px, 5vw, 56px); line-height: 1.04; letter-spacing: -.05em; }
.lead { max-width: 650px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }

.flow-card { display: grid; gap: 18px; padding: 28px; }
.flow-step { display: grid; grid-template-columns: 38px 1fr; gap: 13px; align-items: start; }
.step-no { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); font-weight: 900; }
.flow-step strong { display: block; margin: 2px 0 4px; font-size: 14px; }
.flow-step p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: 24px; align-items: start; }
.card { padding: 26px; }
.card-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.card-head h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.025em; }
.card-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field-compact { margin-bottom: 0; }
.field label { color: #41516a; font-size: 12px; font-weight: 750; }
.field-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: rgba(250, 252, 255, .95);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, select:focus { border-color: #78a1ff; background: #fff; box-shadow: 0 0 0 4px rgba(35,103,242,.1); }
input::placeholder { color: #9ba8b8; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button-row-compact { margin: 0; }
.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { flex: 1; color: #fff; background: linear-gradient(135deg, #3779ff, #1a56d4); box-shadow: 0 12px 24px rgba(35,103,242,.22); }
.btn-secondary { color: #35516f; border-color: var(--line); background: #f7f9fc; }
.btn-danger { color: var(--danger); border-color: #f5ccd1; background: var(--danger-soft); }
.btn-small { min-height: 32px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }

.notice { min-height: 46px; margin-top: 16px; padding: 12px 14px; border-radius: 13px; color: var(--muted); background: #f6f8fb; font-size: 12px; line-height: 1.6; }
.notice[data-tone="success"] { color: #0f704a; background: var(--success-soft); }
.notice[data-tone="warning"] { color: #845306; background: var(--warning-soft); }
.notice[data-tone="danger"] { color: #9c2733; background: var(--danger-soft); }

.result-empty { display: grid; min-height: 280px; place-items: center; text-align: center; }
.empty-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 16px; place-items: center; border-radius: 20px; color: var(--brand); background: var(--brand-soft); font-size: 28px; }
.result-empty h3 { margin: 0 0 8px; font-size: 17px; }
.result-empty p { max-width: 300px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.result { display: grid; gap: 12px; }
.result[hidden], [hidden] { display: none !important; }
.metric { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; }
.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 5px; font-size: 15px; word-break: break-word; }
.number, .sms-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.sms-code { color: var(--success); font-size: 29px !important; letter-spacing: .14em; }

.status-badge { padding: 5px 9px; }
.status-badge[data-state="active"], .status-badge[data-state="waiting_number"], .status-badge[data-state="waiting_payment"] { color: var(--warning); border-color: #f3d9a7; background: var(--warning-soft); }
.status-badge[data-state="success"] { color: var(--success); border-color: #bce5d2; background: var(--success-soft); }
.status-badge[data-state="failed"], .status-badge[data-state="cancelled"], .status-badge[data-state="expired"] { color: var(--danger); border-color: #f2c4ca; background: var(--danger-soft); }

.admin-layout { display: grid; gap: 22px; }
.admin-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; }
.stat span { display: block; color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin-top: 6px; font-size: 23px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 12px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f7f9fc; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.codes-box { min-height: 64px; max-height: 220px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--brand-deep); background: #f7f9fc; white-space: pre-wrap; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.footer { margin-top: 30px; color: var(--muted); text-align: center; font-size: 11px; }

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 32px 26px; }
  .flow-card { grid-template-columns: repeat(3, 1fr); }
  .flow-step { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1080px); padding-top: 14px; }
  .topbar { margin-bottom: 16px; }
  .secure-badge { display: none; }
  .hero-copy, .card { border-radius: 19px; }
  .hero-copy, .card, .flow-card { padding: 20px; }
  h1 { font-size: 34px; }
  .flow-card, .field-row, .admin-toolbar, .stat-grid { grid-template-columns: 1fr; }
  .flow-step { grid-template-columns: 38px 1fr; }
  .button-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
