:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #14161b;
  --panel-strong: #101217;
  --panel-soft: #1c2028;
  --text: #f8f1e9;
  --muted: #c0b7ad;
  --line: #343945;
  --ink: #0a0b0d;
  --sakura: #f07b83;
  --sakura-strong: #ff9a9f;
  --gold: #d9b66e;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08090c;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url("/static/img/shiori-hero.png") center / cover no-repeat fixed;
  filter: saturate(1) contrast(1.02) brightness(1.14);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8,9,12,0.50) 0%, rgba(8,9,12,0.38) 44%, rgba(8,9,12,0.36) 100%),
    linear-gradient(180deg, rgba(8,9,12,0.18) 0%, rgba(8,9,12,0.44) 48%, rgba(8,9,12,0.62) 100%),
    radial-gradient(circle at 14% 6%, rgba(240, 123, 131, 0.16), transparent 25%),
    radial-gradient(circle at 86% 8%, rgba(217, 182, 110, 0.10), transparent 24%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 34px);
}

.page {
  width: min(1160px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 44px;
  scroll-behavior: smooth;
}

.page--order,
.page--text {
  display: grid;
  align-content: start;
  gap: 22px;
}

.hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 0;
}

.hero::after,
.text-panel::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(240, 123, 131, 0.18);
  border-radius: 50%;
  right: 28px;
  bottom: 28px;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: 54px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--sakura-strong);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }

h1 {
  font-size: clamp(50px, 9vw, 104px);
  line-height: 0.92;
}

h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.lead--compact {
  max-width: 620px;
  font-size: 17px;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero__badges span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(10, 11, 13, 0.46);
  color: var(--text);
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 0;
}

.benefits article,
.checkout-form,
.order-panel,
.info-card,
.text-panel {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 94%, black);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.benefits article {
  padding: 16px;
}

.benefits span {
  color: var(--gold);
  font-size: 13px;
}

.benefits h2 {
  margin-top: 12px;
  font-size: 19px;
}

.benefits p,
.info-card p,
.flow-list,
.text-list,
.field small,
.muted,
.next-step p {
  color: var(--muted);
  line-height: 1.6;
}

.checkout {
  padding: 8px 0 0;
}

.how-flow {
  padding: 26px 0 0;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-subtitle {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flow-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.flow-strip li {
  min-height: 74px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 14, 20, 0.50);
  color: var(--muted);
  line-height: 1.5;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.checkout-form,
.order-panel,
.text-panel {
  padding: 24px;
}

.checkout-form,
.order-panel,
.info-card,
.text-panel,
.benefits article {
  background: rgba(10, 14, 20, 0.56);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.benefits article {
  background: rgba(10, 14, 20, 0.50);
}

.checkout-form {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 10px;
}

.field__label {
  color: var(--muted);
  font-size: 14px;
}

.tariff-grid,
.device-grid {
  display: grid;
  gap: 10px;
}

.tariff-grid,
.device-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-card,
.device-option {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), transparent),
    rgba(28, 32, 40, 0.58);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.device-option {
  min-height: 58px;
  place-items: center;
  text-align: center;
}

.option-card:hover,
.device-option:hover,
.option-card.is-selected,
.device-option.is-selected {
  border-color: var(--sakura-strong);
  background: rgba(240, 123, 131, 0.16);
}

.option-card.is-selected,
.device-option.is-selected {
  transform: translateY(-1px);
}

.option-card input,
.device-option input {
  accent-color: var(--sakura);
}

.option-card strong {
  font-size: 22px;
}

input[type="text"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(24, 27, 34, 0.66);
  color: var(--text);
  font: inherit;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(24, 27, 34, 0.66);
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: 2px solid rgba(255, 154, 159, 0.34);
  border-color: var(--sakura-strong);
}

.primary-button,
.secondary-button {
  min-height: 56px;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #dc4650, #ff7f76);
  color: white;
  box-shadow: 0 14px 34px rgba(220, 70, 80, 0.28);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.secondary-button {
  width: 100%;
  margin-top: 16px;
  border: 1px solid rgba(255, 154, 159, 0.32);
  background: rgba(24, 27, 34, 0.56);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--sakura-strong);
  background: rgba(240, 123, 131, 0.12);
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.order-panel h1,
.text-panel h1 {
  font-size: clamp(38px, 6vw, 72px);
}

.order-list {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.order-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.order-list dt {
  color: var(--muted);
}

.order-list dd {
  margin: 0;
}

.status-pill {
  border-color: rgba(255, 154, 159, 0.45);
  color: var(--sakura-strong);
}

.next-step {
  border: 1px solid rgba(217, 182, 110, 0.36);
  border-radius: 8px;
  padding: 18px;
  background: rgba(217, 182, 110, 0.08);
}

.progress-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.progress-line span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(24, 27, 34, 0.62);
  text-align: center;
}

.progress-line .is-active {
  color: var(--text);
  border-color: var(--sakura-strong);
  background: rgba(240, 123, 131, 0.12);
}

.progress-line .is-done {
  color: var(--text);
  border-color: rgba(217, 182, 110, 0.56);
  background: rgba(217, 182, 110, 0.12);
}

.progress-line .is-muted {
  opacity: 0.68;
}

.progress-line .is-error {
  color: var(--text);
  border-color: rgba(255, 118, 118, 0.70);
  background: rgba(220, 70, 80, 0.18);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-card {
  padding: 20px;
}

.config-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.config-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 154, 159, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(217, 182, 110, 0.10), transparent 42%);
}

.config-card > * {
  position: relative;
  z-index: 1;
}

.config-state {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
}

.config-actions {
  margin-top: 18px;
}

.flow-list,
.text-list {
  padding-left: 22px;
}

.text-panel {
  max-width: 920px;
  margin-top: 28px;
  overflow: hidden;
}

.mini-ink {
  position: absolute;
  right: -42px;
  top: -42px;
  width: 190px;
  height: 190px;
  border: 20px solid rgba(255,255,255,0.045);
  border-left-color: rgba(255,154,159,0.14);
  border-radius: 50%;
}

.text-list {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.status-grid div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 32, 40, 0.58);
}

.status-grid span {
  color: var(--muted);
  font-size: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
}

.button-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.button-row button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 24px 0 0;
  color: var(--muted);
}

.site-footer a,
.secondary-link {
  color: var(--sakura-strong);
  text-decoration: none;
}

.site-footer a:hover,
.secondary-link:hover {
  text-decoration: underline;
}

.top-nav {
  position: relative;
  z-index: 5;
  width: min(1160px, calc(100% - 32px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.top-nav__brand,
.top-nav__links a {
  color: var(--text);
  text-decoration: none;
}

.top-nav__brand {
  font-weight: 900;
}

.top-nav__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.top-nav__links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 14, 20, 0.50);
  color: var(--muted);
}

.top-nav__links a:hover {
  border-color: var(--sakura-strong);
  color: var(--text);
}

.auth-panel {
  width: min(720px, 100%);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin: 28px 0 18px;
}

.notice {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(217, 182, 110, 0.36);
  border-radius: 8px;
  background: rgba(217, 182, 110, 0.08);
  color: var(--text);
}

.notice--error {
  border-color: rgba(255, 118, 118, 0.56);
  background: rgba(220, 70, 80, 0.13);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-card-wide {
  grid-column: 1 / -1;
}

.order-history {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.order-history__item {
  display: grid;
  grid-template-columns: 72px 1.2fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 32, 40, 0.58);
  color: var(--muted);
  text-decoration: none;
}

.order-history__item strong {
  color: var(--text);
}

.button-like {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.button-like--secondary {
  background: rgba(28, 32, 40, 0.58);
}

.account-admin-actions {
  margin-top: 22px;
}

.admin-stats,
.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.admin-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stats article,
.admin-status-grid div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 20, 0.50);
}

.admin-stats span,
.admin-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-stats strong,
.admin-status-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 22px;
}

.admin-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: 72px 1.15fr 0.9fr 0.9fr 1.1fr 1.2fr;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 32, 40, 0.56);
  color: var(--muted);
  text-decoration: none;
}

.admin-table--users .admin-row {
  grid-template-columns: 72px 1.25fr 1fr 0.7fr 1.1fr 1.1fr;
}

.admin-row strong {
  color: var(--text);
}

@media (max-width: 860px) {
  .top-nav {
    width: min(100% - 24px, 1160px);
  }

  .page {
    width: min(100% - 24px, 1160px);
    padding: 18px 0 34px;
  }

  .hero {
    min-height: 360px;
  }

  body::before {
    background-position: 58% center;
    background-attachment: scroll;
  }

  .hero__content {
    padding: 34px 0 24px;
  }

  .benefits,
  .tariff-grid,
  .device-grid,
  .info-grid,
  .status-grid,
  .flow-strip,
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-history__item {
    grid-template-columns: 1fr 1fr;
  }

  .admin-stats,
  .admin-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-row,
  .admin-table--users .admin-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 580px) {
  .top-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav__links {
    justify-content: flex-start;
  }

  .hero {
    min-height: 330px;
  }

  h1 {
    font-size: clamp(46px, 16vw, 72px);
  }

  .lead {
    margin-top: 18px;
    font-size: 18px;
  }

  .hero__badges {
    gap: 8px;
    margin-top: 18px;
  }

  .hero__badges span {
    min-height: 28px;
    padding: 0 10px;
    font-size: 13px;
  }

  .benefits {
    margin-top: 22px;
  }

  .benefits article {
    padding: 14px;
  }

  .benefits h2 {
    margin-top: 8px;
    font-size: 18px;
  }

  .benefits p {
    margin: 8px 0 0;
  }

  .checkout {
    padding-top: 6px;
  }

  .how-flow {
    padding-top: 22px;
  }

  .benefits,
  .tariff-grid,
  .device-grid,
  .info-grid,
  .status-grid,
  .progress-line,
  .flow-strip,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .order-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .order-history__item {
    grid-template-columns: 1fr;
  }

  .admin-stats,
  .admin-status-grid,
  .admin-row,
  .admin-table--users .admin-row {
    grid-template-columns: 1fr;
  }

}
