:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1d1f29;
    --muted: #6b7280;
    --border: #e3e6ee;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --success: #16a34a;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 32px rgba(15, 23, 42, 0.06);
    --radius: 12px;
}

* {
    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, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    padding: 18px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.nav a {
    color: var(--muted);
    margin-left: 16px;
}

.nav a:hover {
    color: var(--text);
    text-decoration: none;
}

/* Footer */
.site-footer {
    padding: 24px 0 32px;
    margin-top: 64px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* Hero */
.hero {
    padding: 48px 0 24px;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.hero-card h1 {
    margin: 0 0 24px;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.meta {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 8px;
}

.meta li {
    display: flex;
    gap: 12px;
}

.meta-label {
    color: var(--muted);
    min-width: 160px;
}

.meta-value {
    font-weight: 500;
}

.description {
    color: var(--muted);
    font-size: 17px;
    margin: 24px 0 32px;
    max-width: 640px;
}

/* Info block */
.info-block {
    padding: 48px 0;
}

.info-block h2 {
    margin: 0 0 24px;
    font-size: 22px;
}

.steps {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.steps li {
    margin-bottom: 8px;
}

/* Form */
.form-section {
    padding: 48px 0;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 560px;
    margin: 0 auto;
}

.form-card-narrow {
    max-width: 480px;
}

.form-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.form-subtitle {
    color: var(--muted);
    margin: 0 0 24px;
}

/* ===== Primary CTA: регистрация через бот ===== */
.bot-primary {
    background: linear-gradient(135deg, #e8f4ff 0%, #d9e9fb 100%);
    border: 1px solid #b7d9f5;
    border-radius: 18px;
    padding: 26px 28px;
    margin: 0 0 24px;
}
.bot-primary__top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.bot-primary__icon { flex-shrink: 0; }
.bot-primary__eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #0077b3;
    margin-bottom: 4px;
}
.bot-primary__title {
    font-size: 22px;
    font-weight: 800;
    color: #0a3a5f;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.bot-primary__text {
    color: #2a5478;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 18px;
}
.bot-primary__cta-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.bot-primary__cta {
    flex: 1;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0088cc;
    color: #fff !important;
    padding: 16px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.3);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bot-primary__cta:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 136, 204, 0.4);
    text-decoration: none;
}
.bot-primary__qr {
    width: 130px;
    height: 130px;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.bot-primary__qr svg { width: 100%; height: 100%; }
.bot-primary__qr-label {
    text-align: right;
    font-size: 11px;
    color: #6b8aa3;
    margin: 6px 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.bot-primary__hint {
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    font-size: 13px;
    color: #2a5478;
    line-height: 1.5;
}

@media (max-width: 540px) {
    .bot-primary { padding: 20px 18px; }
    .bot-primary__title { font-size: 19px; }
    .bot-primary__qr { width: 100px; height: 100px; }
    .bot-primary__cta-row { gap: 14px; }
    .bot-primary__cta { width: 100%; flex: none; }
}

/* ===== Fallback-форма: details ===== */
.fallback-form {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    margin-top: 8px;
    background: #fafbfd;
}
.fallback-form__summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 22px;
    user-select: none;
    border-radius: 14px;
    transition: background 0.15s;
}
.fallback-form__summary::-webkit-details-marker { display: none; }
.fallback-form__summary:hover { background: #f3f5fa; }
.fallback-form__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 10px;
    color: var(--muted);
    transition: transform 0.15s;
}
.fallback-form[open] > .fallback-form__summary::before {
    transform: rotate(90deg);
}
.fallback-form__title {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}
.fallback-form__sub {
    color: var(--muted);
    font-size: 13px;
    margin-left: 8px;
}
.fallback-form[open] > .fallback-form__summary {
    border-bottom: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
}
.fallback-form > *:not(.fallback-form__summary) {
    padding-left: 22px;
    padding-right: 22px;
}
.fallback-form > *:last-child:not(.fallback-form__summary) {
    padding-bottom: 22px;
}
.fallback-form__notice {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid #ffe69c;
    border-radius: 6px;
    font-size: 13px;
    color: #5e3a00;
    line-height: 1.5;
}

/* Подсказка зарегистрироваться через бот */
.bot-suggestion {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #e8f4ff 0%, #ddebff 100%);
    border: 1px solid #b7d9f5;
    border-radius: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.bot-suggestion__icon {
    flex-shrink: 0;
    display: flex;
}
.bot-suggestion__body {
    flex: 1;
    min-width: 220px;
}
.bot-suggestion__title {
    font-weight: 700;
    color: #0f3a5f;
    margin-bottom: 4px;
    font-size: 15px;
}
.bot-suggestion__text {
    color: #2a5478;
    font-size: 14px;
    line-height: 1.45;
}
.bot-suggestion__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0088cc;
    color: #fff !important;
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
}
.bot-suggestion__cta:hover {
    background: #0077b3;
    transform: translateY(-1px);
    text-decoration: none;
}

.bot-suggestion__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.bot-suggestion__qr {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #b7d9f5;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bot-suggestion__qr svg { width: 100%; height: 100%; }
.bot-suggestion__qr-label {
    font-size: 11px;
    color: #2a5478;
    text-align: center;
    margin-top: 2px;
    font-weight: 500;
}
.bot-suggestion__hint {
    margin: 8px 0 18px;
    padding: 10px 14px;
    background: #f6f9fc;
    border-left: 3px solid #b7d9f5;
    border-radius: 6px;
    font-size: 13px;
    color: #2a5478;
    line-height: 1.5;
}

@media (max-width: 540px) {
    .bot-suggestion__actions { flex-direction: row; gap: 12px; }
    .bot-suggestion__qr { width: 80px; height: 80px; }
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    margin: 18px 0 22px;
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

/* intl-tel-input: подгоняем под нашу форму */
.field-phone .iti { width: 100%; display: block; }
.field-phone .iti input.iti__tel-input {
    width: 100% !important;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field-phone .iti input.iti__tel-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.field-phone .iti__country-list {
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Состояние валидации телефона */
.field-phone .iti input.iti__tel-input.is-invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.field-phone .iti input.iti__tel-input.is-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.hint-error   { color: var(--error)   !important; }
.hint-success { color: var(--success) !important; }

/* Двухколоночные поля (программа + номер группы) */
.field-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.field-row .field { margin-bottom: 0; }
@media (max-width: 540px) {
    .field-row { grid-template-columns: 1fr; }
}

/* ===== LANDING (новый) ===== */

body.has-hero {
    background: #0a0c26;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.has-hero > main { padding: 0; max-width: none; }

.hero {
    position: relative;
    min-height: 92vh;
    color: #fff;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10, 12, 38, 0)    0%,
        rgba(10, 12, 38, 0)    40%,
        rgba(10, 12, 38, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 100%,
            rgba(255, 255, 255, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}
.hero > .hero-nav,
.hero > .hero-content,
.hero > .hero-scroll-hint {
    position: relative;
    z-index: 2;
}

.hero-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.hero-brand__team {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.02em;
}
.hero-brand { text-decoration: none; }

.hero-nav__menu {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}
.hero-nav__menu a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}
.hero-nav__menu a:hover { color: #fff; }

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 40px 80px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.hero-eyebrow {
    margin: 0 0 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    position: relative;
    display: inline-block;
    padding-left: 28px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.hero-eyebrow::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 18px; height: 1px;
    background: rgba(255, 255, 255, 0.85);
}

.hero-title {
    margin: 0 0 28px;
    font-size: clamp(40px, 6.8vw, 88px);
    line-height: 0.98;
    letter-spacing: -0.035em;
    font-weight: 900;
    max-width: 1100px;
    /* Глубокая тень для читаемости поверх фотографий */
    text-shadow:
        0 2px 18px rgba(0, 0, 0, 0.55),
        0 1px 3px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.hero-dates {
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.hero-location {
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    margin-bottom: 28px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hero-countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 22px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    margin-bottom: 32px;
    align-self: flex-start;
}
.hero-countdown__num {
    font-size: 42px;
    font-weight: 800;
    color: var(--event-accent, #fff);
    line-height: 1;
    letter-spacing: -0.03em;
}
.hero-countdown__label {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #0a0c26;
    padding: 17px 36px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25),
                0 0 0 0 var(--event-accent-soft, transparent);
}
.hero-cta::after {
    content: '→';
    transition: transform 0.2s;
}
.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35),
                0 0 0 6px var(--event-accent-soft, rgba(255,255,255,0.1));
    text-decoration: none;
}
.hero-cta:hover::after { transform: translateX(4px); }

.hero-link {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 14px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.hero-link:hover {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.6);
    text-decoration: none;
}

.hero-closed {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 14px 22px;
    border-radius: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
}

.hero-scroll-hint {
    position: absolute;
    left: 50%; bottom: 32px;
    transform: translateX(-50%);
    width: 24px; height: 36px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    pointer-events: none;
}
.hero-scroll-hint span {
    display: block;
    width: 3px; height: 8px;
    margin: 6px auto 0;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    animation: scroll-dot 1.8s infinite;
}
@keyframes scroll-dot {
    0%, 20% { transform: translateY(0); opacity: 1; }
    80%, 100% { transform: translateY(14px); opacity: 0; }
}

/* секции */
.section {
    padding: 96px 0;
    background: #fafbfd;
    color: var(--text);
}
.section--light { background: #fff; }
.section--cta {
    background: linear-gradient(180deg, #fafbfd 0%, #eef2ff 100%);
    text-align: center;
}
.section--cta .section-text { max-width: 600px; margin: 12px auto 28px; }

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
}
.section-inner--centered { text-align: center; }

.section-title {
    margin: 0 0 16px;
    font-size: clamp(28px, 3.4vw, 42px);
    letter-spacing: -0.02em;
    font-weight: 800;
}

.section-subtitle {
    color: var(--muted);
    margin: 0 0 32px;
    font-size: 17px;
}

.section-text {
    color: var(--text);
    font-size: 17px;
    line-height: 1.65;
    white-space: pre-line;
}

/* Программа */
.program { display: grid; gap: 48px; margin-top: 32px; }

.program-day {
    position: relative;
    padding-left: 24px;
}
.program-day::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: var(--event-accent, var(--primary));
    border-radius: 2px;
    opacity: 0.6;
}

.program-day__title {
    font-size: 22px;
    margin: 0 0 18px;
    color: var(--event-accent, var(--primary));
    font-weight: 700;
    letter-spacing: -0.01em;
}
.program-day__weekday {
    color: var(--muted);
    font-weight: 500;
    font-size: 16px;
    margin-left: 6px;
}

.program-day__entries {
    display: grid;
    gap: 20px;
}

.program-day__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

/* Блок (несколько пунктов в одной локации) */
.program-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03),
                0 4px 16px rgba(15, 23, 42, 0.04);
}
.program-block__header {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}
.program-block__title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.program-block__location {
    font-size: 14px;
    color: var(--muted);
}
.program-block__address {
    color: var(--muted);
    font-size: 13px;
}
.program-block__map {
    display: inline-block;
    margin-top: 6px;
    color: var(--event-accent, var(--primary));
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.program-block__map:hover { text-decoration: underline; }
.program-block__note {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.program-block__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.program-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    align-items: baseline;
}
.program-item:first-child { border-top: 0; padding-top: 4px; }

.program-item__time {
    font-weight: 700;
    font-size: 20px;
    color: var(--event-accent, var(--primary));
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.program-item__title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 16px;
}
.program-item__desc { color: var(--muted); font-size: 15px; }
.program-item__note {
    margin-top: 6px;
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Inline-редактирование программ пользователя */
.user-programs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.user-program-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fafbfd;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.user-program-row select,
.user-program-row input[type="text"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.user-program-row .up-program-select { flex: 2; min-width: 180px; }
.user-program-row .up-group-input,
.user-program-row .up-custom-input { flex: 1; min-width: 160px; }
.user-program-row .checkbox-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--muted);
    white-space: nowrap;
}

/* Карточки организаторов */
.organizers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.org-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
a.org-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15,23,42,0.08);
    border-color: var(--event-accent, var(--primary));
    text-decoration: none;
}
.org-card__avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--event-accent-soft, #eef2ff);
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}
.org-card__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--event-accent, #7c5cff), #4f46e5);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.org-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}
.org-card__name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.org-card__program {
    color: var(--event-accent, var(--primary));
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.org-card__subtitle {
    color: var(--muted);
    font-size: 14px;
}
.org-card__role {
    margin-top: 8px;
    display: inline-block;
    padding: 4px 12px;
    background: var(--event-accent-soft, #eef2ff);
    color: var(--event-accent, var(--primary));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 720px) {
    /* Карточки организаторов: на мобильном — аватар слева, текст справа */
    .organizers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .org-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 14px 16px;
    }
    .org-card__avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .org-card__avatar--initials { font-size: 22px; }
    .org-card__info { align-items: flex-start; gap: 2px; }
    .org-card__name { font-size: 16px; }
    .org-card__program { font-size: 12px; }
    .org-card__subtitle { font-size: 13px; }
    .org-card__role { margin-top: 4px; align-self: flex-start; }

    .hero-nav { padding: 16px 20px; }
    .hero-nav__menu { display: none; }
    .hero-content { padding: 40px 20px 60px; }
    .hero-title { font-size: 38px; }
    .section { padding: 48px 0; }
    .section-inner { padding: 0 20px; }
    .section-title { font-size: 24px; }
    .program-item { grid-template-columns: 72px 1fr; }
}

/* ===== ADMIN: nav + inline forms ===== */
.admin-nav {
    display: flex;
    gap: 20px;
    margin-left: 32px;
}
.admin-nav a {
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}
.admin-nav a:hover { color: var(--text); }

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0 4px 0 0;
}
.inline-form input[type="text"],
.inline-form input[type="number"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}
.inline-form input[type="text"] { min-width: 220px; }

/* Программы — форма добавления */
.add-program-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.add-program-form__name { flex: 1; min-width: 260px; }
.add-program-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.move-buttons {
    display: flex;
    gap: 4px;
}
.move-buttons .btn { padding: 4px 10px; font-size: 13px; min-width: 32px; }

.program-name-input {
    min-width: 220px;
}

.badge-soft {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 500;
}

/* HTML mini-editor */
.html-editor-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.html-editor-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s;
}
.html-editor-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.html-editor-btn:active { background: var(--primary-soft); }

.html-editor-preview-label {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}
.html-editor-preview {
    margin-top: 4px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #fafbfd;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    min-height: 36px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.html-editor-preview:empty::before {
    content: "Здесь появится превью";
    color: var(--muted);
    font-style: italic;
}

/* WYSIWYG (contenteditable) — выглядит как textarea, но рендерит форматирование */
.rich-editor {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.rich-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.rich-editor.is-empty::before {
    content: attr(data-placeholder-text);
    color: var(--muted);
    pointer-events: none;
}
.rich-editor b, .rich-editor strong { font-weight: 700; }
.rich-editor i, .rich-editor em { font-style: italic; }
.rich-editor u { text-decoration: underline; }
.rich-editor s, .rich-editor strike, .rich-editor del { text-decoration: line-through; }
.rich-editor a { color: var(--primary); text-decoration: underline; }
.rich-editor code {
    font-family: ui-monospace, "SF Mono", monospace;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

/* ===== Редактор мероприятия ===== */

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}
.edit-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.edit-card h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.edit-card h3 {
    margin: 16px 0 8px;
    font-size: 15px;
    color: var(--text);
}
.edit-card textarea,
.edit-card input[type="text"],
.edit-card input[type="datetime-local"],
.edit-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.edit-card textarea:focus,
.edit-card input:focus,
.edit-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.edit-card input[type="color"] {
    width: 80px; height: 40px; padding: 2px;
    border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.field-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .edit-grid { grid-template-columns: 1fr; }
    .field-grid { grid-template-columns: 1fr; }
}

/* Программа в редакторе — карточки */
.program-edit-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.program-item-card {
    position: relative;
    padding: 16px;
    background: #fafbfd;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}

.program-block-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 14px;
    overflow: hidden;
}
.program-block-card__summary {
    cursor: pointer;
    padding: 16px 20px;
    list-style: none;
    font-size: 16px;
    background: linear-gradient(180deg, #fafbfd 0%, #f3f5fc 100%);
    border-bottom: 1px solid var(--border);
    user-select: none;
}
.program-block-card__summary::-webkit-details-marker { display: none; }
.program-block-card__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s;
    color: var(--muted);
}
.program-block-card details[open] > .program-block-card__summary::before {
    transform: rotate(90deg);
}
.program-block-card__title { font-weight: 600; }
.program-block-edit {
    padding: 16px 20px;
    background: #fafbfd;
    border-bottom: 1px solid var(--border);
}
.program-block-card details[open] > * { padding-left: 20px; padding-right: 20px; }
.program-block-card details[open] > .program-block-card__summary { padding-left: 20px; }
.program-block-card details > *:last-child { padding-bottom: 20px; }
.program-block-edit .program-item-grid { background: transparent; }
.program-block-card select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.program-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.program-item-grid .field-full { grid-column: 1 / -1; }

.program-item-grid .field { margin-bottom: 0; }
.program-item-grid label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.program-item-grid input,
.program-item-grid textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.program-item-grid textarea { resize: vertical; min-height: 56px; }
.program-item-grid input:focus,
.program-item-grid textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.program-item-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.program-item-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
}

.add-program-item {
    border-top: 1px dashed var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

@media (max-width: 720px) {
    .program-item-grid { grid-template-columns: 1fr; }
}

/* Фото в редакторе */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.photo-card {
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.photo-card__img {
    width: 100%;
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
}
.photo-card__body { padding: 8px; }
.photo-card__caption { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.photo-card__actions { display: flex; gap: 4px; }

.add-photo {
    border-top: 1px dashed var(--border);
    padding-top: 16px;
}
.add-photo-form .field { margin-bottom: 10px; }
.add-photo-form .field label {
    display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted);
}

/* ===== Галерея на лендинге ===== */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 24px;
}
.gallery-item {
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    background-color: #e5e7eb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s;
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item__caption {
    color: #fff;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.7) 100%);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    height: 100%;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
}

.req {
    color: var(--error);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover { text-decoration: none; }

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--text);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
}

/* Success */
.text-center { text-align: center; }

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);
    font-size: 32px;
    line-height: 64px;
    text-align: center;
    margin: 0 auto 16px;
    font-weight: 700;
}

.lead {
    font-size: 17px;
    color: var(--muted);
    margin: 8px 0 24px;
}

/* ===== ADMIN ===== */

.admin-body {
    background: #fafbfd;
}

.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 16px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.admin-name {
    font-weight: 500;
    white-space: nowrap;
}

.brand { white-space: nowrap; }

/* На узких экранах навигация уходит на отдельную строку под заголовок,
   так имя пользователя и кнопка выхода больше не накладываются друг на друга. */
@media (max-width: 1024px) {
    .admin-nav { order: 3; width: 100%; margin-left: 0; gap: 14px; }
}

.logout-form {
    margin: 0;
}

.btn-link {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.btn-link:hover {
    color: var(--error);
    text-decoration: underline;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
    text-transform: uppercase;
}

.role-super_admin { background: #fef3c7; color: #92400e; }
.role-organizer   { background: var(--primary-soft); color: var(--primary); }
.role-check_in    { background: #dcfce7; color: var(--success); }

.admin-section { padding: 32px 0 16px; }

.admin-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-toolbar h1 {
    margin: 0;
    font-size: 22px;
}

.create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
}
.create-form input[type="text"],
.create-form input[type="datetime-local"] {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.create-form input[type="text"]:focus,
.create-form input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.create-form .btn { white-space: nowrap; }

.filter-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.filter-tab {
    padding: 6px 12px;
    color: var(--muted);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.filter-tab:hover {
    color: var(--text);
    background: var(--bg);
    text-decoration: none;
}

.filter-tab.is-active {
    background: var(--primary);
    color: #fff;
}

.filter-count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 11px;
    line-height: 18px;
}

.filter-tab:not(.is-active) .filter-count {
    background: var(--bg);
    color: var(--muted);
}

.event-filter select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font: inherit;
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.search-bar .search-input {
    flex: 1;
    min-width: 280px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.search-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font: inherit;
    max-width: 220px;
}

/* table */
.data-table {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: #fafbfd;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tr:hover td {
    background: #fafbfd;
}

.cell-strong { font-weight: 500; }
.cell-muted  { color: var(--muted); font-size: 13px; }

.row-rejected td { opacity: 0.55; }

.source-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.source-web { background: var(--primary-soft); color: var(--primary); }
.source-bot { background: #e0f2fe; color: #0369a1; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pending   { background: #fef3c7; color: #92400e; }
.status-approved  { background: #dcfce7; color: var(--success); }
.status-rejected  { background: var(--error-bg); color: var(--error); }
.status-cancelled { background: var(--bg); color: var(--muted); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.empty-state {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

/* Detail page */
.breadcrumbs {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs span { margin: 0 6px; }

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.detail-card h1 { margin: 0; font-size: 22px; }
.detail-card h2 { margin: 0 0 12px; font-size: 16px; color: var(--muted); }

.kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    margin: 0;
    font-size: 14px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.detail-card hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* Фото заявителя в карточке заявки — крупно, как в карточке профиля */
.applicant-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: start;
}
.applicant-photo img {
    width: 100%;
    max-width: 220px;
    max-height: 280px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: block;
}
.applicant-photo__placeholder {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-soft), #fff);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 700;
    border: 1px dashed var(--border);
}
.applicant-kv { margin: 0; }

@media (max-width: 600px) {
    .applicant-row { grid-template-columns: 1fr; }
    .applicant-photo img,
    .applicant-photo__placeholder {
        max-width: 160px;
        font-size: 56px;
    }
}

.reject-form label,
.reject-form textarea {
    display: block;
    width: 100%;
}
.reject-form label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.reject-form textarea {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
    .filter-tabs { margin-left: 0; }
    .kv { grid-template-columns: 1fr; gap: 4px; }
    .kv dd { margin-bottom: 8px; }
}
