:root {
  --bg: #0a0809;
  --bg-elevated: #141012;
  --bg-card: #1a1214;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8f4f4;
  --text-muted: #a89a9c;
  --accent: #ef4444;
  --accent-dim: #b91c1c;
  --accent-glow: rgba(239, 68, 68, 0.28);
  --accent-soft: #fca5a5;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% -15%, rgba(185, 28, 28, 0.22), transparent),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(127, 29, 29, 0.12), transparent);
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 8, 9, 0.88);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo__img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 28px var(--accent-glow);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.logo__text {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cart-btn:hover {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

.cart-btn__count {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: fit-content;
  margin: 0;
  padding: 0.4rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
}

.hero__badge-sep {
  opacity: 0.55;
  font-weight: 400;
  line-height: 1;
}

.hero__title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.15em 0.35em;
}

.hero__title-focus {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.hero__title-focus .hero__badge {
  font-size: clamp(0.62rem, 1.8vw, 0.76rem);
  padding: 0.35rem 0.95rem;
}

.hero__title-part,
.hero__title-word {
  background: linear-gradient(135deg, #fff, var(--accent-soft), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 auto;
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero__stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.stat {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  min-width: 140px;
}

.stat strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent);
}

.stat span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section__head {
  margin-bottom: 1.75rem;
}

.section__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section__head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.section__head p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Product card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--bg-card);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: var(--shadow);
}

.card--popular {
  border-color: rgba(239, 68, 68, 0.45);
}

.card__popular {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card__banner {
  padding: 1.25rem 1.25rem 0;
}

.rank-badge {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-sizing: border-box;
}

.rank-badge--long {
  font-size: 0.72rem;
  letter-spacing: 0.015em;
}

.rank-badge--sm {
  width: auto;
  max-width: 96px;
  min-height: 32px;
  padding: 0.4rem 0.55rem;
  font-size: 0.58rem;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-badge--jr-helper {
  background: linear-gradient(90deg, #d8c4f0 0%, #e91e8c 100%);
}

.rank-badge--sr-helper {
  background: linear-gradient(90deg, #7b3fe4 0%, #c026d3 100%);
}

.rank-badge--head-helper {
  background: linear-gradient(90deg, #ef4444 0%, #3f0d12 100%);
}

.rank-badge--unwarn {
  background: linear-gradient(90deg, #fbbf24 0%, #991b1b 100%);
}

.rank-badge--vacation {
  background: linear-gradient(90deg, #22d3ee 0%, #7c3aed 100%);
}

.rank-badge--quota-week {
  background: linear-gradient(90deg, #34d399 0%, #0d9488 45%, #1e3a5f 100%);
}

.rank-badge--quota-forever {
  background: linear-gradient(90deg, #6b7280 0%, #111827 100%);
}

.rank-badge--points {
  background: linear-gradient(90deg, #22d3ee 0%, #1e3a8a 45%, #991b1b 100%);
}

.card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__subtitle {
  margin: 0.25rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.card__perks {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
}

.card__perks li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  color: #c5d0e0;
}

.card__perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.price {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
}

.price--unset {
  font-size: 0.95rem;
  color: var(--warning);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.btn--block {
  width: 100%;
}

/* Points card */
.points-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.points-card__visual .rank-badge {
  max-width: 420px;
  margin-inline: auto;
}

.points-card__form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.points-input-wrap {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.points-input-wrap input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.points-input-wrap input:focus {
  outline: none;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.points-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.preset-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.preset-btn:hover,
.preset-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(239, 68, 68, 0.1);
}

.points-total {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Rules */
.rules {
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
  padding: 1.5rem 1.75rem;
}

.rules h3 {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fca5a5;
  font-size: 1rem;
}

.rules ol {
  margin: 0;
  padding-left: 1.25rem;
  color: #e8c4c4;
}

.rules li {
  margin-bottom: 0.75rem;
}

.rules li:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer a {
  color: var(--accent-soft);
}

.footer a:hover {
  color: var(--accent);
}

.footer__contact {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* Cart drawer */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 200;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 201;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.drawer__head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.drawer__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
}

.cart-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.cart-item__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-item__price {
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}

.cart-item__remove {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
}

.cart-item__remove:hover {
  color: var(--danger);
}

.drawer__foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.cart-total strong {
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--accent);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 300;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal__box {
  width: min(480px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition: transform 0.3s;
}

.modal.open .modal__box {
  transform: translateY(0);
}

.modal__box h3 {
  margin: 0 0 0.5rem;
}

.modal__box p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.form-group input:focus {
  outline: none;
  border-color: rgba(239, 68, 68, 0.5);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.consent input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal__actions .btn {
  flex: 1;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 400;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.success-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
}

.success-page__box {
  max-width: 520px;
  margin-inline: auto;
  text-align: center;
}

.success-page__text {
  color: var(--text-muted);
  margin: 0;
}

.success-page__btn {
  margin-top: 1.5rem;
  display: inline-flex;
}

.legal-doc {
  min-height: calc(100vh - 80px);
  padding-bottom: 3rem;
}

.legal-doc__box {
  max-width: 720px;
  margin-inline: auto;
  text-align: left;
}

.legal-doc__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-align: center;
}

.legal-doc__lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.92rem;
}

.legal-doc__card {
  margin-bottom: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.legal-doc__table {
  width: 100%;
  border-collapse: collapse;
}

.legal-doc__table th,
.legal-doc__table td {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal-doc__table tr:last-child th,
.legal-doc__table tr:last-child td {
  border-bottom: none;
}

.legal-doc__table th {
  width: 38%;
  color: var(--text-muted);
  font-weight: 500;
  padding-right: 1rem;
}

.legal-doc__policy h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.legal-doc__policy p {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.legal-doc__policy p:last-child {
  margin-bottom: 0;
}

.legal-doc__back {
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .nav a:not(.cart-btn) {
    display: none;
  }

  .points-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }
}
