/* ==========================================================================
   Система регистрации на конференцию — базовые стили
   ========================================================================== */

:root {
    --plum-900: #33131F;
    --plum-800: #4A1F35;
    --plum-700: #6D2E46;
    --plum-600: #8C4360;
    --rose-400: #C97B84;
    --rose-200: #E8B4B8;
    --rose-100: #F5DEDD;
    --cream: #FDF8F5;
    --sand: #F3E9E3;
    --gold: #B8912F;
    --ink: #2B1B23;
    --muted: #7A6670;
    --line: #E6D8D3;
    --white: #FFFFFF;
    --green: #2E7D5B;
    --green-bg: #E4F3EB;
    --amber: #B57614;
    --amber-bg: #FBF0DA;
    --red: #B3261E;
    --red-bg: #FBE6E4;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(51, 19, 31, .06), 0 8px 24px rgba(51, 19, 31, .07);
    --shadow-lg: 0 2px 6px rgba(51, 19, 31, .08), 0 20px 50px rgba(51, 19, 31, .14);
    --serif: "Georgia", "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--cream);
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--plum-700);
}

small {
    font-size: .82rem;
}

.container {
    width: min(100% - 2rem, 960px);
    margin-inline: auto;
}

.container-narrow {
    width: min(100% - 2rem, 620px);
    margin-inline: auto;
}

/* --- Шапка публичной части ------------------------------------------------ */
.site-header {
    background: linear-gradient(135deg, var(--plum-800), var(--plum-600) 70%, var(--rose-400));
    color: var(--white);
    padding: 1rem 0 1.2rem;
}

.site-header a {
    color: rgba(255, 255, 255, .92);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    margin: 0;
}

.site-meta {
    font-size: .85rem;
    opacity: .85;
}

.lang-switch {
    display: flex;
    gap: .25rem;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: .2rem;
}

.lang-switch a {
    padding: .22rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    text-decoration: none;
    color: rgba(255, 255, 255, .85);
}

.lang-switch a.is-active {
    background: var(--white);
    color: var(--plum-800);
    font-weight: 600;
}

.hero {
    padding: 2.2rem 0 1.4rem;
}

.hero h1 {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    margin-bottom: .3rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.4rem;
    color: var(--muted);
    font-size: .95rem;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

main {
    padding: 1.5rem 0 3rem;
}

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

.card-tight {
    padding: 1rem 1.1rem;
}

.card h2:first-child, .card h3:first-child {
    margin-top: 0;
}

/* --- Формы ---------------------------------------------------------------- */
.field {
    margin-bottom: 1.05rem;
}

.field label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: .35rem;
}

.field .hint {
    color: var(--muted);
    font-weight: 400;
    font-size: .82rem;
}

input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%;
    padding: .7rem .85rem;
    font: inherit;
    font-size: .97rem;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--plum-600);
    box-shadow: 0 0 0 3px rgba(140, 67, 96, .14);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.field-error input, .field-error select {
    border-color: var(--red);
}

.error-text {
    color: var(--red);
    font-size: .85rem;
    margin-top: .3rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 1rem;
}

@media (max-width: 640px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Выбор способа оплаты */
.pay-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
}

@media (max-width: 560px) {
    .pay-options {
        grid-template-columns: 1fr;
    }
}

.pay-option {
    position: relative;
}

.pay-option input {
    position: absolute;
    opacity: 0;
}

.pay-option label {
    display: block;
    cursor: pointer;
    height: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    background: var(--white);
    transition: all .15s;
}

.pay-option label strong {
    display: block;
    font-size: 1rem;
}

.pay-option label span {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 400;
}

.pay-option input:checked + label {
    border-color: var(--plum-700);
    background: var(--rose-100);
    box-shadow: 0 0 0 3px rgba(140, 67, 96, .12);
}

.pay-option input:focus-visible + label {
    box-shadow: 0 0 0 3px rgba(140, 67, 96, .3);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .93rem;
}

.checkbox input {
    width: 18px;
    height: 18px;
    margin-top: .15rem;
    accent-color: var(--plum-700);
}

/* --- Кнопки --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .7rem 1.25rem;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    background: var(--plum-700);
    color: var(--white);
}

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

.btn:active {
    transform: translateY(1px);
}

.btn-lg {
    padding: .9rem 1.7rem;
    font-size: 1.03rem;
    width: 100%;
}

.btn-sm {
    padding: .38rem .7rem;
    font-size: .82rem;
}

.btn-ghost {
    background: transparent;
    color: var(--plum-700);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: var(--sand);
    color: var(--plum-800);
}

.btn-success {
    background: var(--green);
}

.btn-success:hover {
    background: #24634a;
}

.btn-danger {
    background: var(--red);
}

.btn-danger:hover {
    background: #8e1e18;
}

.btn-gold {
    background: var(--gold);
    color: #241a05;
}

.btn-gold:hover {
    background: #a07d26;
}

.btn[disabled], .btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

body.cookie-consent-visible {
    padding-bottom: var(--cookie-banner-space, 0px);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* --- Сообщения ------------------------------------------------------------ */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .93rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--green-bg);
    border-color: #B7E0C9;
    color: #1D5C42;
}

.alert-warning {
    background: var(--amber-bg);
    border-color: #EFD9A6;
    color: #7A5310;
}

.alert-error {
    background: var(--red-bg);
    border-color: #F0C3BE;
    color: #8E1E18;
}

.alert-info {
    background: var(--rose-100);
    border-color: var(--rose-200);
    color: var(--plum-800);
}

/* --- Cookie consent ------------------------------------------------------- */
.cookie-banner {
    box-sizing: border-box;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: .95rem max(1rem, calc((100vw - 960px) / 2)) calc(.95rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .98);
    border: 0;
    border-top: 3px solid var(--plum-700);
    border-radius: 0;
    box-shadow: 0 -10px 30px rgba(51, 19, 31, .13);
}

.cookie-banner__content h2 {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 .25rem;
}

.cookie-banner__content p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

.cookie-banner__content a,
.cookie-banner__actions .btn {
    white-space: nowrap;
}

.cookie-banner__actions,
.cookie-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 27, 35, .54);
}

.cookie-modal__panel {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: min(720px, calc(100vh - 2rem));
    overflow: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.4rem;
}

.cookie-modal__panel h2 {
    font-family: var(--sans);
    font-size: 1.35rem;
    font-weight: 800;
}

.cookie-options {
    display: grid;
    gap: .75rem;
    margin: 1.2rem 0;
}

.cookie-option {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
}

.cookie-option h3 {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 .2rem;
}

.cookie-option p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

.cookie-required {
    color: var(--green);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.cookie-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cookie-switch {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 999px;
    background: #C9C9C9;
    cursor: pointer;
    transition: background .15s;
}

.cookie-switch::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    transition: transform .15s;
}

.cookie-toggle:checked + .cookie-switch {
    background: var(--green);
}

.cookie-toggle:checked + .cookie-switch::after {
    transform: translateX(22px);
}

.cookie-toggle:focus-visible + .cookie-switch {
    box-shadow: 0 0 0 3px rgba(140, 67, 96, .22);
}

.cookie-modal-open {
    overflow: hidden;
}

.cookie-policy-list {
    display: grid;
    gap: .8rem;
    margin: 1rem 0 1.4rem;
}

.cookie-policy-list section {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: #FFFCFA;
}

.cookie-policy-list h3 {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 .25rem;
}

.cookie-policy-list p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 760px) {
    .cookie-banner {
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
    }

    .cookie-banner__actions,
    .cookie-modal__actions {
        flex-direction: column;
    }

    .cookie-banner .btn,
    .cookie-modal .btn {
        width: 100%;
        min-height: 46px;
    }

    .cookie-modal__panel {
        padding: 1rem;
    }

    .cookie-option {
        grid-template-columns: 1fr;
        gap: .7rem;
    }
}

/* --- Значки статуса ------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-paid {
    background: var(--green-bg);
    color: #1D5C42;
}

.badge-pending {
    background: var(--amber-bg);
    color: #7A5310;
}

.badge-cancelled {
    background: var(--red-bg);
    color: #8E1E18;
}

.badge-attended {
    background: var(--rose-100);
    color: var(--plum-800);
}

.badge-muted {
    background: var(--sand);
    color: var(--muted);
}

/* --- Билет ---------------------------------------------------------------- */
.ticket {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--line);
}

.ticket-head {
    background: linear-gradient(135deg, var(--plum-800), var(--plum-600));
    color: var(--white);
    padding: 1.4rem 1.5rem;
}

.ticket-head h2 {
    margin: 0;
    color: var(--white);
    font-size: 1.35rem;
}

.ticket-head .ticket-sub {
    opacity: .85;
    font-size: .9rem;
}

.ticket-body {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 560px) {
    .ticket-body {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

.ticket-qr {
    background: var(--white);
    padding: .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.ticket-qr svg {
    display: block;
    width: 190px;
    height: 190px;
}

.ticket-fields dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .45rem 1rem;
}

.ticket-fields dt {
    color: var(--muted);
    font-size: .85rem;
}

.ticket-fields dd {
    margin: 0;
    font-weight: 600;
}

.ticket-number {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.25rem;
    letter-spacing: .04em;
    color: var(--plum-800);
}

.ticket-perforation {
    border-top: 2px dashed var(--line);
    margin: 0 1.5rem;
}

.ticket-foot {
    padding: 1rem 1.5rem 1.4rem;
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
}

/* --- Прочее --------------------------------------------------------------- */
.qr-pay {
    text-align: center;
}

.qr-pay img {
    max-width: 260px;
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
}

.link-box {
    display: flex;
    gap: .5rem;
    align-items: center;
    background: var(--sand);
    border-radius: var(--radius-sm);
    padding: .55rem .7rem;
    font-size: .82rem;
    word-break: break-all;
}

.muted {
    color: var(--muted);
}

.text-center {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 1.3rem 0;
    border: 0;
}

.site-footer {
    padding: 1.5rem 0 2.5rem;
    color: var(--muted);
    font-size: .85rem;
    text-align: center;
}

.site-footer a {
    color: var(--plum-700);
}

@media print {
    .site-header, .site-footer, .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .ticket {
        box-shadow: none;
        border: 1.5px solid #333;
    }
}
