/* =====================================================================
   Публичная страница
   ===================================================================== */

:root {
    --brand:        #2c3e50;
    --brand-light:  #34495e;
    --gold:         #d4af37;
    --gold-dark:    #b8962d;
    --bg:           #f4f7f6;
    --surface:      #ffffff;
    --text:         #2c3e50;
    --text-muted:   #6b7a83;
    --danger:       #d9534f;
    --success:      #4a9d5f;
    --border:       #e3e8e6;
    --radius:       12px;
    --shadow:       0 8px 24px rgba(0, 0, 0, .07);
}

#tgSubmit {
    margin-top: 10px;
}

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

/* Атрибут hidden обязан работать всегда.
   Без этого правила авторское display:flex перебивает стиль браузера
   [hidden]{display:none} - и баннеры/панели видны постоянно. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 13px 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--gold);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .1s, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled)  { background: var(--gold-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled              { opacity: .55; cursor: not-allowed; }
.btn-sm                    { padding: 9px 16px; font-size: .9rem; }
.btn-block                 { width: 100%; }

.btn-primary { background: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-light); }

.btn-ghost {
    background: transparent;
    border-color: currentColor;
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }

/* --- Шапка --- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--brand);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    padding: 14px 0;
    /* Учитываем "безопасную зону" на iPhone с вырезом */
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
}
.nav-container { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.logo { color: #fff; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-actions .btn-ghost { color: #fff; }

/* --- Hero --- */
.hero { padding: 64px 0; }
.hero-content { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.text-block { flex: 1 1 320px; }
.text-block h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.2; margin-bottom: 18px; }
.text-block p  { font-size: 1.08rem; color: var(--text-muted); margin-bottom: 26px; }
.photo-block { flex: 1 1 260px; display: flex; justify-content: center; }
.photo-block img {
    width: 100%;
    max-width: 380px;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    object-fit: cover;
}


/* --- Форма записи --- */
.contact { padding: 56px 0 72px; background: var(--surface); }

.booking-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 36px 30px;
    background: #fdfdfe;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.booking-card h2 { text-align: center; font-size: 1.5rem; margin-bottom: 6px; }
.form-hint     { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 24px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.req { color: var(--danger); }

input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #ccd4d1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}
input[aria-invalid="true"] { border-color: var(--danger); }

.field-hint  { margin-top: 5px; font-size: .82rem; color: var(--text-muted); }
.field-error { margin-top: 5px; font-size: .85rem; color: var(--danger); }
.field-error:not(:empty) { min-height: 1.2em; }

.consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 4px 0 20px;
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
}
.consent input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--brand); }

/* Honeypot: уводим за пределы экрана, но не display:none (боты это игнорируют) */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-message { margin-top: 16px; text-align: center; font-size: .95rem; }
.form-message:not(:empty) { padding: 12px 14px; border-radius: 8px; }
.form-message.ok   { background: #e4f5ea; color: #1d6b38; border: 1px solid #b8e3c8; }
.form-message.err  { background: #fdeaea; color: #9a2b27; border: 1px solid #f5c2c0; }
.form-message.info { background: #eaf1fb; color: #24528c; border: 1px solid #bcd6f5; }

/* --- Экран успеха --- */
#stepSuccess { text-align: center; }
.success-icon { color: var(--success); margin-bottom: 12px; }
.success-details {
    margin: 18px 0;
    padding: 16px;
    background: #f2f7f4;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: left;
}
.success-details .row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: .95rem;
}
.success-details .row + .row { border-top: 1px dashed var(--border); }
.success-details .label { color: var(--text-muted); }
.success-details .value { font-weight: 600; text-align: right; }
.success-note { font-size: .9rem; color: var(--text-muted); margin-bottom: 20px; }

/* --- Подвал --- */
.site-footer {
    padding: 26px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
    padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
}

/* --- Баннеры --- */
.offline-banner, .update-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    font-size: .9rem;
    font-weight: 500;
}
.offline-banner { background: #7a3b3b; color: #fff; }
.update-banner  { background: var(--brand); color: #fff; }

/* --- Адаптивность --- */
@media (max-width: 720px) {
    .hero { padding: 40px 0; }
    .hero-content { flex-direction: column; text-align: center; }
    .text-block p { font-size: 1rem; }
    .booking-card { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}
