:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f5f8fc;
  --ink: #0b1220;
  --ink-muted: #5b6572;
  --border: #e3e8ef;
  --blue: #2952e3;
  --blue-dark: #1f3fc0;
  --blue-tint: #eef2ff;
  --black: #0b0d12;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  color: var(--black);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(11, 13, 18, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 17px;
  color: var(--black);
  text-decoration: none;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.site-header nav a:hover {
  color: var(--blue);
}

/* Page layout */

.page {
  padding: 72px 24px;
}

.page-narrow {
  max-width: 640px;
}

.center {
  text-align: center;
}

.hero {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-tint);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 16px;
}

.lead {
  color: var(--ink-muted);
  font-size: 17px;
  max-width: 640px;
  margin: 0 auto;
}

.price {
  font-weight: 700;
  font-size: 20px;
  margin-top: 12px;
  color: var(--black);
}

.price-large {
  font-size: 30px;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.delivery-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-tint);
  padding: 6px 12px;
  border-radius: 999px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-list li {
  font-size: 14px;
  color: var(--ink);
  padding-left: 26px;
  position: relative;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue-tint);
  border: 1.5px solid var(--blue);
}

.feature-list li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 6px;
  height: 3px;
  border-left: 1.5px solid var(--blue);
  border-bottom: 1.5px solid var(--blue);
  transform: rotate(-45deg);
}

/* Package grid */

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.package-card {
  display: block;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.package-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(41, 82, 227, 0.25);
}

.package-card h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.package-card p {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0;
}

/* Cards & forms */

.card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 28px;
  margin-top: 24px;
}

form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-tint);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0;
}

button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: var(--blue-dark);
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.btn-link:hover {
  background: var(--blue-dark);
  text-decoration: none;
}

.message-body {
  font-size: 14px;
  line-height: 1.7;
  margin: 8px 0 0;
}

.error {
  color: #dc2626;
  font-size: 14px;
}

.success {
  color: #15803d;
  font-size: 14px;
}

.warning {
  color: #b45309;
  font-size: 13px;
  margin-top: 8px;
}

.link-btn {
  width: auto;
  background: none;
  color: var(--ink-muted);
  padding: 0;
  font-weight: 500;
  font-size: 13px;
  text-decoration: underline;
}

.link-btn:hover {
  background: none;
  color: #dc2626;
}

/* Cart */

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.cart-row-info {
  flex: 1;
  min-width: 0;
}

.cart-row-name {
  font-weight: 600;
  margin: 0;
  font-size: 14px;
}

.cart-row-price {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 2px 0 0;
}

.cart-row-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-row-qty input {
  width: 60px;
  margin: 0;
  padding: 8px;
  text-align: center;
}

.cart-row-qty button {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.cart-row-subtotal {
  font-weight: 700;
  min-width: 90px;
  text-align: right;
  margin: 0;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--black);
  margin-top: 20px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
}

/* Footer */

.site-footer {
  background: var(--black);
  color: #a3adc2;
  padding: 48px 0;
  font-size: 13px;
  margin-top: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 20px;
}

.footer-links a {
  text-decoration: none;
  color: #cfd6e6;
  font-weight: 500;
}

.footer-links a:hover {
  color: #fff;
}

.site-footer p {
  margin: 4px 0;
}

/* Legal pages */

.legal section {
  margin-top: 28px;
}

.legal h2 {
  font-size: 16px;
}

.legal p {
  color: #333c48;
  font-size: 14px;
}

.updated {
  color: var(--ink-muted);
  font-size: 13px;
}

.info-list p {
  font-size: 15px;
}

.info-list span:first-child {
  color: var(--ink-muted);
  margin-right: 8px;
}

/* Admin */

.admin-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background: var(--bg-subtle);
}

.login-card {
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 40px -20px rgba(11, 18, 32, 0.15);
}

.login-logo {
  height: 36px;
  width: auto;
  display: block;
  margin: 0 auto 20px;
}

.login-card h1 {
  font-size: 20px;
  margin-top: 0;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--black);
  color: #cfd6e6;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 28px;
}

.admin-brand-icon {
  height: 26px;
  width: auto;
  display: block;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.admin-sidebar nav a {
  text-decoration: none;
  color: #cfd6e6;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 500;
}

.admin-sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.logout-link {
  margin-top: auto;
  color: #8891a3;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}

.logout-link:hover {
  color: #fff;
}

.admin-main {
  flex: 1;
  padding: 36px 40px;
  background: var(--bg-subtle);
}

.admin-main h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header-row h1 {
  margin-bottom: 0;
}

.admin-header-row .btn-link {
  margin-top: 0;
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.actions-cell form {
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
}

.stat-label {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 0;
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 0;
  color: var(--black);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.orders-table th {
  text-align: left;
  color: var(--ink-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--bg-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.orders-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.orders-table tr:last-child td {
  border-bottom: none;
}

.orders-table a {
  text-decoration: none;
  font-weight: 500;
}

.orders-table a:hover {
  text-decoration: underline;
}

.orders-table .empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 32px;
}

.status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-pending { color: #92400e; background: #fef3c7; }
.status-paid { color: #166534; background: #dcfce7; }
.status-failed { color: #991b1b; background: #fee2e2; }
.status-refunded { color: #475569; background: #f1f5f9; }
.status-partially_refunded { color: #9a3412; background: #ffedd5; }
.status-new { color: #1e40af; background: #dbeafe; }
.status-read { color: #475569; background: #f1f5f9; }

.detail-card .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-card .row:last-child {
  border-bottom: none;
}

.detail-card .row span:first-child {
  color: var(--ink-muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.muted {
  color: var(--ink-muted);
  font-size: 13px;
}

.mode {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 0;
}

.mode-live { color: #dc2626; }
.mode-test { color: #b45309; }
.mode-not-set { color: var(--ink-muted); }

.check-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 14px;
}

.check-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.check-list li:last-child {
  border-bottom: none;
}

.check-list .ok { color: #166534; font-weight: 600; }
.check-list .error { color: #dc2626; font-weight: 600; }

@media (max-width: 640px) {
  h1 {
    font-size: 30px;
  }
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
  }
  .admin-sidebar nav {
    flex-direction: row;
  }
  .admin-brand {
    display: none;
  }
  .logout-link {
    margin-top: 0;
  }
  .admin-main {
    padding: 24px 20px;
  }
  .cart-row {
    flex-wrap: wrap;
  }
  .cart-row-subtotal {
    text-align: left;
    order: 1;
  }
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.package-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.package-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.package-grid .reveal:nth-child(4) { transition-delay: 0.24s; }

.feature-list.reveal li {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.feature-list.reveal.is-visible li {
  opacity: 1;
  transform: translateX(0);
}

.feature-list.reveal li:nth-child(1) { transition-delay: 0.05s; }
.feature-list.reveal li:nth-child(2) { transition-delay: 0.1s; }
.feature-list.reveal li:nth-child(3) { transition-delay: 0.15s; }
.feature-list.reveal li:nth-child(4) { transition-delay: 0.2s; }
.feature-list.reveal li:nth-child(5) { transition-delay: 0.25s; }
.feature-list.reveal li:nth-child(6) { transition-delay: 0.3s; }

/* Back to top */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(41, 82, 227, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.15s;
  z-index: 20;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--blue-dark);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .feature-list.reveal li {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .back-to-top {
    transition: none;
  }
}
