/* DigitalKey — светлая тема, для печати */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --border: #e1e5ec;
  --text: #0f172a;
  --text-muted: #5b6577;
  --primary: #2c5cdd;
  --primary-dark: #1f47b8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.05);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, Segoe UI, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.brand {
  font-weight: 700; font-size: 1.15rem;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}
.brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), #5a82ee);
  color: #fff; border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem;
}
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--primary); }

/* ===== Page layout ===== */
.container { max-width: 1180px; margin: 0 auto; padding: 36px 28px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 36px 28px; }

.page-title { font-size: 1.85rem; font-weight: 700; margin-bottom: 6px; }
.page-subtitle { color: var(--text-muted); margin-bottom: 28px; }

/* ===== Hero (index) ===== */
.hero {
  background: linear-gradient(135deg, #eef3ff 0%, #f8f9ff 100%);
  border: 1px solid #dde6fb;
  border-radius: 14px;
  padding: 44px 40px;
  margin-bottom: 36px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px;
  align-items: center;
}
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 14px; }
.hero p { color: var(--text-muted); margin-bottom: 22px; max-width: 460px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  background: #fff; border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 100px;
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
}
.hero-illu {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem; color: var(--text-muted);
}
.hero-illu .key-line { padding: 4px 0; }
.hero-illu .key-tag { color: var(--primary); }

/* ===== Section ===== */
.section-title {
  font-size: 1.25rem; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title .more { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* ===== Product grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,23,42,0.08); }
.product-thumb {
  width: 100%; aspect-ratio: 16/10;
  background: var(--surface-2); border-radius: 8px;
  margin-bottom: 16px;
  display: grid; place-items: center;
  font-family: 'Inter', sans-serif; font-weight: 700;
  color: var(--text-muted); font-size: 0.95rem;
  border: 1px solid var(--border);
}
.thumb-megahack { background: linear-gradient(135deg, #fff7e6, #fffbf2); color: #a25a00; }
.thumb-windows { background: linear-gradient(135deg, #e8f1ff, #f3f8ff); color: #1b4cb3; }
.thumb-winrar { background: linear-gradient(135deg, #f1ecff, #faf8ff); color: #5a3aaa; }
.thumb-office { background: linear-gradient(135deg, #ffe8e8, #fff5f5); color: #b53a3a; }
.thumb-photoshop { background: linear-gradient(135deg, #e5f0ff, #f2f7ff); color: #155cb5; }
.thumb-idm { background: linear-gradient(135deg, #e9f9ee, #f5fcf7); color: #1a7a3a; }

.product-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.product-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; flex: 1; }
.product-card .meta-row {
  display: flex; align-items: center; justify-content: space-between;
}
.price { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.price-old { color: var(--text-muted); text-decoration: line-through; font-size: 0.85rem; margin-left: 8px; font-weight: 500; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-weight: 600; font-size: 0.92rem;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #128541; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

/* ===== Product page ===== */
.product-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 32px;
}
.product-main {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.product-aside {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  height: fit-content; position: sticky; top: 88px;
}
.product-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; }
.product-sub { color: var(--text-muted); margin-bottom: 22px; }
.product-image {
  width: 100%; aspect-ratio: 16/9;
  border-radius: 8px; margin-bottom: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  font-weight: 700; font-size: 1.6rem;
}
.product-features {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 18px 22px;
  margin-top: 20px;
}
.product-features h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.product-features ul { list-style: none; }
.product-features li { padding: 6px 0 6px 24px; position: relative; font-size: 0.95rem; }
.product-features li:before {
  content: '✓'; position: absolute; left: 0; top: 6px;
  color: var(--success); font-weight: 700;
}

.aside-price { font-size: 2rem; font-weight: 700; margin-bottom: 4px; }
.aside-old { color: var(--text-muted); text-decoration: line-through; font-size: 0.95rem; margin-bottom: 14px; }
.aside-stock {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--success); font-size: 0.85rem; font-weight: 500;
  margin-bottom: 18px;
}
.aside-stock:before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); display: inline-block;
}
.aside-row { margin-bottom: 14px; }
.aside-row label {
  display: block; font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 6px; font-weight: 500;
}
.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 0.95rem;
  background: var(--surface);
}
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.aside-foot {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}

/* ===== Checkout ===== */
.checkout-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 28px;
}
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.panel h2 { font-size: 1.15rem; margin-bottom: 16px; }
.pay-method {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}
.pay-method.active {
  border-color: var(--primary);
  background: #f3f7ff;
}
.pay-method-icon {
  width: 44px; height: 32px; border-radius: 5px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.75rem; color: var(--text-muted);
}
.pay-method-info { flex: 1; }
.pay-method-name { font-weight: 600; font-size: 0.95rem; }
.pay-method-desc { color: var(--text-muted); font-size: 0.82rem; }

.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
}
.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 14px;
  font-weight: 700; font-size: 1.1rem;
}

/* ===== Success / delivery ===== */
.success-icon {
  width: 64px; height: 64px;
  background: #dcfce7; color: var(--success);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 700;
  margin: 0 auto 18px;
}
.center { text-align: center; }
.key-box {
  background: #fafbfd;
  border: 1.5px dashed var(--primary);
  border-radius: 8px;
  padding: 18px 22px;
  font-family: 'JetBrains Mono', monospace, monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  word-break: break-all;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}
.copy-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 14px;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}
.copy-btn:hover { background: var(--surface-2); }

.info-note {
  background: #f3f7ff; border: 1px solid #dde6fb;
  border-radius: 8px; padding: 14px 18px;
  font-size: 0.9rem; color: #1b3a8a;
  margin: 16px 0;
}

/* ===== Admin ===== */
.admin-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
}
.admin-side {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  height: fit-content;
}
.admin-side h4 { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.admin-side ul { list-style: none; margin-bottom: 18px; }
.admin-side li a {
  display: block; padding: 8px 12px;
  border-radius: 6px; color: var(--text);
  font-size: 0.92rem; font-weight: 500;
}
.admin-side li a:hover { background: var(--surface-2); text-decoration: none; }
.admin-side li a.active { background: #eef3ff; color: var(--primary); }

.admin-main {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface-2);
  border-radius: 8px; padding: 16px 18px;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.stat-delta { font-size: 0.8rem; margin-top: 2px; }
.delta-up { color: var(--success); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left; padding: 12px 14px;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }

.tag {
  display: inline-block;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.78rem; font-weight: 500;
}
.tag-success { background: #dcfce7; color: #146b3a; }
.tag-pending { background: #fef3c7; color: #92590a; }
.tag-failed { background: #fee2e2; color: #b62121; }
.tag-muted { background: var(--surface-2); color: var(--text-muted); }

.code { font-family: 'JetBrains Mono', monospace, monospace; font-size: 0.88rem; }

.admin-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.search {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; min-width: 280px; font-family: inherit;
  background: var(--surface);
}

/* ===== Form ===== */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.92rem; }
.form-row .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
textarea.input { min-height: 130px; font-family: 'JetBrains Mono', monospace; resize: vertical; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== Footer ===== */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 26px 0;
  margin-top: 60px;
  color: var(--text-muted); font-size: 0.85rem;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 28px; display: flex; justify-content: space-between; }
