/* ============================================================
   shop.qr-me.ru — Стили
   Тёмная тема, mobile-first, Inter шрифт
   ============================================================ */

/* --- Переменные цветов --- */
:root {
    --bg:      #0D0D1A;
    --surface: #1A1A2E;
    --purple:  #7C3AED;
    --cyan:    #06B6D4;
    --text:    #F8FAFC;
    --muted:   #94A3B8;
    --border:  rgba(124, 58, 237, 0.25);
    --radius:  16px;
}

/* --- Сброс и базовые стили --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Фоновая анимация --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6,182,212,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Контейнер --- */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   ШАПКА
   ============================================================ */
.header {
    padding: 20px 0;
    text-align: center;
}

.logo {
    text-decoration: none;
    display: inline-block;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

/* ============================================================
   HERO — главный блок
   ============================================================ */
.hero {
    padding: 48px 0 32px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeUp 0.5s ease both;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--purple);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(32px, 8vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    animation: fadeUp 0.5s 0.1s ease both;
}

.hero h1 .gradient {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--muted);
    max-width: 420px;
    margin: 0 auto 40px;
    animation: fadeUp 0.5s 0.2s ease both;
}

/* ============================================================
   КАРТОЧКА ЗАКАЗА
   ============================================================ */
.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px 28px;
    margin-bottom: 48px;
    animation: fadeUp 0.5s 0.3s ease both;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

/* --- Email поле --- */
.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.field input[type="email"] {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.field input[type="email"]::placeholder {
    color: var(--muted);
}

.field input[type="email"]:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* --- Выбор количества --- */
.quantity-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.quantity-label .price-hint {
    font-size: 12px;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.qty-btn {
    width: 52px;
    height: 52px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover {
    background: rgba(124,58,237,0.2);
    color: var(--purple);
}

.qty-btn:active {
    background: rgba(124,58,237,0.35);
}

.qty-input {
    flex: 1;
    background: transparent;
    border: none;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-family: inherit;
    outline: none;
    padding: 0;
    min-width: 0;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* --- Итоговая цена --- */
.total-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(124,58,237,0.08);
    border: 1px solid rgba(124,58,237,0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 24px 0;
}

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

.total-price {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.2s;
}

/* --- Кнопка покупки --- */
.btn-buy {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--purple), #5b21b6);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn-buy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.08));
}

.btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.4);
}

.btn-buy:active {
    transform: translateY(0);
    box-shadow: none;
    opacity: 0.9;
}

.btn-buy:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Загрузка кнопки --- */
.btn-buy .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.btn-buy.loading .btn-text { display: none; }
.btn-buy.loading .spinner   { display: block; }

/* --- Ошибка формы --- */
.form-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #fca5a5;
    margin-top: 16px;
    display: none;
}

.form-error.show {
    display: block;
    animation: fadeUp 0.2s ease;
}

/* --- Сноска про безопасность --- */
.secure-note {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ============================================================
   КАК ЭТО РАБОТАЕТ
   ============================================================ */
.how-it-works {
    padding: 0 0 64px;
    animation: fadeUp 0.5s 0.4s ease both;
}

.how-it-works h2 {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px;
    transition: border-color 0.2s;
}

.step:hover {
    border-color: var(--border);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.step-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-body p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ============================================================
   СТРАНИЦА УСПЕХА
   ============================================================ */
.success-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.success-hero {
    padding: 64px 0 48px;
    text-align: center;
    animation: fadeUp 0.5s ease both;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(6,182,212,0.2));
    border: 2px solid var(--purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 24px;
    animation: scaleIn 0.4s 0.2s ease both;
}

.success-hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.success-hero p {
    color: var(--muted);
    font-size: 16px;
    max-width: 340px;
    margin: 0 auto;
}

.success-hero .email-highlight {
    color: var(--cyan);
    font-weight: 600;
}

/* --- FAQ блок --- */
.faq {
    padding-bottom: 64px;
    animation: fadeUp 0.5s 0.2s ease both;
}

.faq h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    padding: 18px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: color 0.2s;
}

.faq-question:hover { color: var(--purple); }

.faq-arrow {
    font-size: 18px;
    transition: transform 0.25s;
    flex-shrink: 0;
    color: var(--muted);
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding-bottom: 18px;
}

/* ============================================================
   СТРАНИЦА ОШИБКИ
   ============================================================ */
.fail-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.fail-icon {
    font-size: 56px;
    margin-bottom: 24px;
}

.fail-page h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
}

.fail-page p {
    color: var(--muted);
    font-size: 16px;
    max-width: 320px;
    margin: 0 auto 32px;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: #fff;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.4);
}

/* ============================================================
   АДМИНКА
   ============================================================ */
.admin-wrap {
    min-height: 100vh;
    padding: 40px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-title {
    font-size: 22px;
    font-weight: 800;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.orders-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.orders-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.orders-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    vertical-align: middle;
}

.orders-table tr:last-child td { border-bottom: none; }
.orders-table tr:hover td { background: rgba(255,255,255,0.02); }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending  { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.status-paid     { background: rgba(6,182,212,0.15);   color: #06B6D4; }
.status-issued   { background: rgba(34,197,94,0.15);   color: #22c55e; }
.status-failed   { background: rgba(239,68,68,0.15);   color: #ef4444; }

/* --- Форма входа в админку --- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 32px;
    animation: fadeUp 0.4s ease both;
}

.login-card h1 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.input-field {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.input-field:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--purple), #5b21b6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 16px;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-logout:hover { background: rgba(239,68,68,0.2); }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

/* Мобильная адаптация таблицы */
@media (max-width: 600px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .orders-table th:nth-child(4),
    .orders-table td:nth-child(4) { display: none; } /* скрываем сумму на мобиле */
}

/* ============================================================
   АНИМАЦИИ
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.footer {
    text-align: center;
    padding: 24px 0 40px;
    color: var(--muted);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover { color: var(--text); }
