/* Байдарские родники — ЛК участников акции
   Фирменный стиль: соответствует основному сайту байдарскиеродники.рф
   Палитра: navy #071a2d, red #d71920, blue #104da1, green #84c731, ice #edf5f8 */

:root {
    --navy: #071a2d;
    --navy-2: #0d2a46;
    --ink: #152235;
    --muted: #637083;
    --red: #d71920;
    --red-dark: #a90f16;
    --blue: #104da1;
    --green: #84c731;
    --ice: #edf5f8;
    --paper: #fbfcfd;
    --white: #fff;
    --line: rgba(18, 43, 68, .13);
    --shadow: 0 18px 45px rgba(7, 26, 45, .10);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }

/* ── Шапка (в стиле site-header основного сайта) ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px;
    margin-bottom: 28px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff;
    box-shadow: 0 24px 55px rgba(7, 26, 45, .28);
}
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.25)); flex-shrink: 0; }
.header h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 22px; letter-spacing: -.02em; margin: 0; }
.header .sub { font-size: 13px; opacity: .8; margin-top: 2px; }
.header .logout {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
    padding: 9px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s;
}
.header .logout:hover { background: rgba(255, 255, 255, .26); }

/* ── Заголовки секций (Georgia, как на сайте) ── */
.card h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -.02em;
    margin-bottom: 14px;
    color: var(--navy);
}
.card h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 18px; margin-bottom: 10px; color: var(--navy); }

/* ── Карточки ── */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

/* ── Формы ── */
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=number], select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 14px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(16, 77, 161, .12); }

/* ── Кнопки (в стиле .button сайта: круглые) ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(215, 25, 32, .28); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
    background: var(--ice);
    color: var(--navy);
}
.btn-secondary:hover { background: #dbe9ef; box-shadow: none; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red-dark); }
.btn-small { width: auto; padding: 9px 18px; font-size: 13px; }

/* ── Уведомления ── */
.alert {
    padding: 13px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}
.alert.error { background: #fdeceb; color: var(--red-dark); border: 1px solid #f3c2bf; }
.alert.success { background: #eef8e2; color: #4c7a15; border: 1px solid #cfe5ab; }
.alert.info { background: var(--ice); color: var(--navy); border: 1px solid #c9dce6; }
.alert.show { display: block; }

/* ── Таблица покупок ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

/* ── Банер победителя ── */
.winner-banner {
    background: linear-gradient(135deg, #fdf3d7, #f8e3ae);
    border: 1px solid #eccf7e;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
    box-shadow: 0 14px 35px rgba(215, 25, 32, .08);
}
.winner-banner.show { display: block; }
.winner-banner .prize { font-size: 19px; font-weight: 700; color: #7d3c00; margin-bottom: 6px; font-family: Georgia, 'Times New Roman', serif; }
.winner-banner .contact { font-size: 15px; color: #5a2d00; }

/* ── Сканер ── */
.scanner-wrap { position: relative; }
video {
    width: 100%;
    max-height: 420px;
    border-radius: 16px;
    background: var(--navy);
    object-fit: cover;
}
.scan-controls { display: flex; gap: 10px; margin-top: 14px; }
.scan-controls .btn { flex: 1; }
.camera-hint { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 45, .6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 18px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(7, 26, 45, .3);
}
.modal h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 22px; margin-bottom: 12px; color: var(--navy); }
.modal .close {
    float: right;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
}

/* ── Спрятанные блоки ── */
.hidden { display: none !important; }

/* ── Мелкие ── */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tabs .btn { flex: 1; }

.muted { color: var(--muted); font-size: 13px; }
.mt { margin-top: 12px; }
.center { text-align: center; }
.link { color: var(--blue); background: none; border: none; cursor: pointer; font-size: 14px; text-decoration: underline; padding: 0; }

.phone-verify-note { font-size: 12px; color: var(--muted); margin-top: -8px; margin-bottom: 14px; }

/* ── Админка ── */
.admin-search { display: flex; gap: 10px; }
.admin-search input { margin-bottom: 0; flex: 1; }
.user-row {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.user-row .name { font-weight: 700; color: var(--navy); }
.user-row .meta { font-size: 13px; color: var(--muted); }
.user-row .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-row input { margin-bottom: 0; padding: 9px 12px; font-size: 14px; }
.user-row.winner { border-color: #eccf7e; background: #fffaf0; }
.winner-badge { display: inline-block; background: #f5b041; color: #7d3c00; padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

@media (max-width: 768px) {
    .container { padding: 16px 12px 40px; }
    .card { padding: 18px; }
    .card h2 { font-size: 22px; }
    th, td { padding: 9px 8px; font-size: 13px; }
}

@media (max-width: 520px) {
    .header { padding: 14px 12px; border-radius: 14px; gap: 8px; }
    .header-left { gap: 10px; min-width: 0; }
    .header-logo { width: 38px; height: 38px; }
    .header h1 { font-size: 17px; line-height: 1.15; }
    .header .sub { font-size: 11px; }
    .header .logout { padding: 7px 12px; font-size: 12px; }
    .card { padding: 16px; border-radius: 14px; }
    .scan-controls { flex-direction: column; }
    .admin-search { flex-direction: column; }
    .user-row .actions { flex-direction: column; align-items: stretch; }
    .user-row .actions input { width: 100%; }
    .user-row .actions .btn { width: 100%; }
    .modal { padding: 16px; }
    .btn { padding: 13px 18px; }
}

@media (max-width: 380px) {
    .header h1 { font-size: 15px; }
    .header .sub { display: none; }
    .header .logout { padding: 6px 10px; font-size: 11px; }
    .card h2 { font-size: 20px; }
    input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=number], select { font-size: 16px; padding: 11px 12px; }
}
