/* frontend/css/style.css
   Единый CSS для VirtSMS: mobile-first, адаптивный, тёмная тема, анимации */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #d1d5db;
  --primary: #1976d2;
  --primary-hover: #1565c0;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --code-bg: #d1fae5;
  --code-text: #047857;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --gap: 16px;
  --max-w: 480px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #131a2b;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #374151;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --code-bg: #064e3b;
    --code-text: #6ee7b7;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 24px; margin: 0 0 8px; text-align: center; }
h2 { font-size: 18px; margin: 24px 0 8px; }
h3 { font-size: 15px; margin: 16px 0 8px; color: var(--text-muted); }

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

select, input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

button {
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button:hover { background: var(--primary-hover); }
button:active { transform: scale(0.98); }
button:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }

button.success { background: var(--success); }
button.success:hover { background: var(--success-hover); }
button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-hover); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--bg); }

.error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 14px;
  display: none;
  animation: shake 0.4s ease;
}

.success-msg {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ===== Адаптив: tablet+ ===== */
@media (min-width: 600px) {
  :root { --max-w: 560px; }
  h1 { font-size: 28px; }
  .container { padding: 32px 24px 64px; }
}

/* ===== Адаптив: desktop ===== */
@media (min-width: 1024px) {
  :root { --max-w: 640px; }
  .card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
}

/* ===== PWA install button ===== */
.pwa-install-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: auto;
  margin: 0;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  cursor: pointer;
  animation: bounce-in 0.5s ease;
}

@keyframes bounce-in {
  0%   { transform: translateY(20px); opacity: 0; }
  60%  { transform: translateY(-6px); opacity: 1; }
  100% { transform: translateY(0); }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer a { margin: 0 6px; }

/* ===== Status badges (history) ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge.waiting_payment { background: #fef3c7; color: #92400e; }
.badge.waiting_sms     { background: #dbeafe; color: #1e40af; }
.badge.completed       { background: #d1fae5; color: #065f46; }
.badge.failed          { background: #fee2e2; color: #991b1b; }
.badge.refunded        { background: #e0e7ff; color: #3730a3; }

@media (prefers-color-scheme: dark) {
  .badge.waiting_payment { background: #78350f; color: #fef3c7; }
  .badge.waiting_sms     { background: #1e3a8a; color: #dbeafe; }
  .badge.completed       { background: #064e3b; color: #d1fae5; }
  .badge.failed          { background: #7f1d1d; color: #fee2e2; }
  .badge.refunded        { background: #312e81; color: #e0e7ff; }
}

/* ===== History table ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
tr:last-child td { border-bottom: none; }

/* ===== Code display (order page) ===== */
.code-display {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--code-text);
  background: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  letter-spacing: 4px;
  margin: 16px 0;
  animation: pulse-code 2s ease infinite;
}

@keyframes pulse-code {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

/* ===== Timer (order page) ===== */
.timer {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--primary);
  margin: 16px 0;
}
.timer.warn   { color: var(--warning); }
.timer.danger { color: var(--danger); animation: pulse-code 1s ease infinite; }

/* ===== Phone (order page) ===== */
.phone {
  font-size: 28px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text);
  letter-spacing: 0.5px;
  -webkit-user-select: all;
  user-select: all;
}

/* ============================================================
   Продающие блоки на главной (index.html)
   ============================================================ */

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 8px 0 16px;
}
.hero h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 12px;
}
.hero-price {
  display: inline-block;
  margin: 0 0 12px;
  padding: 8px 20px;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--success));
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.3);
  animation: pulse-code 2.5s ease infinite;
}
.hero-price-old {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  text-decoration: line-through;
  margin-left: 6px;
}

/* ===== Benefits (Зачем это нужно) ===== */
.benefits-list,
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.benefits-list li:last-child { border-bottom: none; }
.benefit-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.benefits-list li > div { flex: 1; }
.benefits-list li b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.benefits-list li p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ===== Steps (Как это работает) ===== */
.steps-list {
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.steps-list li:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}
.steps-list li > div { flex: 1; }
.steps-list li b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.steps-list li p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ===== Order form / radio countries ===== */
.order-card {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.12);
}
.country-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.country-option:hover {
  border-color: var(--primary);
  background: rgba(25, 118, 210, 0.04);
}
.country-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.country-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(25, 118, 210, 0.08);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}
.country-name { flex: 1; }
.country-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ===== CTA кнопка ===== */
.cta-btn {
  background: linear-gradient(135deg, var(--primary), var(--success)) !important;
  color: #fff !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  padding: 14px 16px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.25);
  margin-top: 18px !important;
}
.cta-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.35);
}
.cta-btn--big {
  font-size: 18px !important;
  padding: 16px 20px !important;
}
.form-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== CTA-блок внизу страницы ===== */
.cta-bottom {
  text-align: center;
  padding: 24px 16px;
  margin: 16px 0 24px;
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.08), rgba(16, 185, 129, 0.08));
  border-radius: 16px;
  border: 1px solid var(--border);
}
.cta-bottom h2 {
  text-align: center;
  margin: 0 0 6px;
  font-size: 20px;
}
.cta-bottom-sub {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.cta-bottom-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* ===== Платёжные системы ===== */
.pay-systems {
  text-align: center;
}
.pay-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pay-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.pay-visa {
  color: #1a1f71;
  font-style: italic;
  font-weight: 900;
  font-size: 18px;
}
.pay-mc {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 38px;
  height: 24px;
}
.mc-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: absolute;
}
.mc-red    { background: #eb001b; left: 0; }
.mc-yellow { background: #f79e1b; left: 14px; mix-blend-mode: multiply; }
.pay-bk {
  color: #0050b3;
  font-weight: 800;
  font-size: 13px;
}
.pay-erip {
  color: #2e7d32;
  font-weight: 800;
  font-size: 14px;
}

/* ===== FAQ ===== */
.faq h2 { margin-bottom: 4px; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.faq-item summary:hover { color: var(--primary); }

/* ===== Адаптив: tablet+ для продающих блоков ===== */
@media (min-width: 600px) {
  .hero h1 { font-size: 30px; }
  .hero-price { font-size: 32px; }
  .cta-bottom h2 { font-size: 24px; }
}


