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

body {
    font-family: 'Roboto Flex', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #000000;
    color: #FFFFFF;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 0;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Градиент поверх блюра, как в макете: #141417 от 0% (прозрачный) до 100% (непрозрачный) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(20, 20, 23, 0) 0%, rgba(20, 20, 23, 1) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Невидимая hit-area "Назад" */
.back-hit-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 190px;
    height: 112px;
    z-index: 3000;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    -webkit-tap-highlight-color: transparent;
    color: rgba(255, 255, 255, 0.92); /* цвет стрелки */
}

.back-hit-area .back-icon {
    margin-left: 16px;
    opacity: 0.92; /* стрелка видимая */
    pointer-events: none; /* кликаем по кнопке (hit-area) */
}

.back-hit-area:focus {
    outline: none;
}

/* Кнопка "Закрыть" (справа сверху) */
.close-hit-area {
    position: fixed;
    top: 0;
    right: 0;
    width: 190px;
    height: 112px;
    z-index: 3000;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    /*display: flex;*/
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
    color: rgba(255, 255, 255, 0.92);
}

.close-hit-area:focus {
    outline: none;
}

.close-hit-area .close-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.2px;
    opacity: 0.92;
    pointer-events: none;
}

.close-hit-area .close-icon {
    margin-right: 16px;
    opacity: 0.92;
    pointer-events: none;
}

/* Контейнер виджета */
.widget-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(45, 45, 52, 0.85) 0%, rgba(28, 28, 32, 0.95) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    border-radius: 10px;
}

/* Этапы */
.stage {
    width: 100%;
    max-width: 480px;
}

/* Логотип */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px 0px 20px;
    background: transparent;
    width: 100%;
    max-width: 480px;
}

.logo-image {
    height: 26px;
    width: auto;
    opacity: 0.95;
    cursor: pointer;
}

.logo-icon {
    width: 32px;
    height: 32px;
    opacity: 0.95;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.95);
}

.stage {
    display: none;
    margin-bottom: 40px;
}

.stage.active {
    display: block;
}

/* Постер события */
.event-poster {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 10px 10px 0 0;
}

.poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    display: block;
}

/* Информация о событии */
.event-info {
    padding: 20px 24px;
    background: transparent;
    margin: 0;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.info-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: -0.1px;
}

.change-order-link {
    display: inline-block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline dotted rgba(255, 255, 255, 0.35);
    padding: 0px 0 12px 0px;
    letter-spacing: -0.1px;
}

.change-order-link:hover {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline dotted rgba(255, 255, 255, 0.6);
}

.age-restriction {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    letter-spacing: -0.1px;
}

.event-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.3px;
    cursor: pointer;
}

.event-details {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.1px;
    display: flex;
    align-items: center;
    gap: 0;
}

.event-location {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.separator {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* Список билетов */
.tickets-list {
    padding: 12px 24px;
}

.ticket-item {
    background: transparent;
    border-radius: 0;
    padding: 16px 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ticket-item:first-child {
    padding-top: 0px;
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ticket-info {
    flex: 1;
}

.ticket-price {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.ticket-price.original {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: line-through;
    font-size: 18px;
    font-weight: 400;
}

.price-original {
    text-decoration: line-through; 
    color: rgba(255,255,255,0.4); 
    margin-right: 20px;
}

.ticket-price.discount {
    color: #fff;
    margin-right: 20px;
}

.ticket-name {
    font-size: 15px;
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: rgba(255, 255, 255, 0.9);
}

.ticket-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 3px;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.ticket-warning {
    font-size: 12px;
    color: #FF9F0A;
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.ticket-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-top: 9px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover:not(:disabled) {
    color: rgba(255, 255, 255, 0.9);
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    width: 48px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 0 4px;
    -moz-appearance: textfield;
    font-family: Inter;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Промокод */
.promo-section {
    padding: 32px 16px 20px;
    background: transparent;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.promo-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.32);
    text-decoration-style: dotted;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.promo-link:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.promo-applied {
    background: rgba(61, 195, 109, 0.08);
    border: 1px solid rgba(24, 237, 101, 0.25);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promo-section.has-promo .promo-links {
    margin-top: 8px;
}

.promo-applied span {
    color: #0EF662;
    font-size: 13px;
    font-weight: 300;
}

.promo-remove {
    background: none;
    border: none;
    color: rgba(0, 255, 88, 0.68);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 10px 0;
    color: #ACAACA;
    font-size: 13px;
    font-weight: 400;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

.promo-discount-amount {
    color: #ACAACA;
    white-space: nowrap;
}

/* Итого */
.order-summary {
    padding: 16px 24px;
    background: rgba(28, 28, 32, 0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Плавающая копия .order-summary (#floatingSummary в разметке): появляется, когда выбран
   билет, но настоящая панель с кнопкой "Продолжить" не видна на экране (см. script.js —
   updateFloatingSummaryVisibility/initFloatingSummaryObserver). Стили карточки и тени —
   как у .widget-container, чтобы панель выглядела частью той же формы. */
.floating-summary {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(45, 45, 52, 0.2) 0%, rgba(28, 28, 32, 0.2) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    border-radius: 10px 10px 0 0;
    padding: 16px 24px;
    z-index: 900;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-summary.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.total-info {
    flex: 1;
}

.total-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-price-row > span:first-child {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.total-check {
    display: inline-block;
    width: 24px;
    height: 24px;
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.65);
}

.total-check.active {
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.85);
}

.total-ticket-icon {
    display: block;
    width: 24px;
    height: 24px;
}

.total-tickets {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
    font-weight: 400;
}

.btn-continue {
    font-family: Inter;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

/* 
    media query для iOS Safari
    Этот хак срабатывает только в WebKit (iOS Safari + iOS WebView + Telegram WebApp).
*/
@supports (-webkit-touch-callout: none) {
  .btn-continue {
    font-weight: 600;
  }
}

.btn-continue:hover:not(:disabled) {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
}

.btn-continue:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Форма покупателя */
.form-header {
    padding: 20px 24px;
    background: transparent;
    margin: 0;
    margin-bottom: 0;
}

.order-details {
    padding: 12px 24px 20px;
    background: transparent;
    margin: 0;
    margin-bottom: 0;
}

.order-total {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid #ffffff45;
}

.buyer-form {
    padding: 20px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(157, 157, 157, 0.15) 100%);
    border: none;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    text-align: center;
    letter-spacing: .2px;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.form-group input:focus {
    outline: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(157, 157, 157, 0.20) 100%);
    border-color: rgba(255, 255, 255, 0.18);
}

.consents {
    margin: 24px 0;
}

/* Tooltip-ошибка для согласий */
.consents-tooltip {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1.5px solid #EF4444;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    color: #EF4444;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.4;
}

.consents-tooltip.active {
    display: flex;
}

.inline-error-icon {
    font-size: 12px;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #EF4444;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-label.is-error .toggle-switch {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.9);
}

/* Подсказка о вероятной опечатке в email (не блокирует отправку формы) */
.email-hint {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1.5px solid #F59E0B;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    color: #B45309;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.4;
}

.email-hint.active {
    display: flex;
}

.email-hint a {
    color: #B45309;
    font-weight: 500;
    text-decoration: underline;
}

.email-hint .hint-icon {
    font-size: 12px;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #F59E0B;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle switch стиль */
.toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.45;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 50px;
    height: 30px;
    background: rgba(120, 120, 130, 0.5);
    border-radius: 15px;
    position: relative;
    flex-shrink: 0;
    margin-top: 0;
    transition: background 0.25s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: #34C759;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.toggle-text {
    flex: 1;
    padding-top: 5px;
}

.consent-link {
    color: #FFFFFF;
    font-weight: 600;
    text-decoration: none;
}

.consent-link:hover {
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #2196F3;
}

.selected-tickets {
    padding: 0;
    background: transparent;
    margin-bottom: 0;
}

.selected-ticket-item {
    display: flex;
    justify-content: space-between;
    /* Выравниваем пунктир и цену по нижней границе текста */
    align-items: flex-end;
    padding: 0 0 12px 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    gap: 8px;
}

.selected-ticket-item .ticket-name-col {
    flex-shrink: 0;
}

.selected-ticket-item .ticket-dots {
    flex: 1;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
    margin: 0 8px;
    height: 1px;
    align-self: flex-end;
    margin-bottom: 5px;
}

.selected-ticket-item .ticket-price-col {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

.selected-ticket-item:last-child {
    border-bottom: none;
}

.payment-summary {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 16px 0;
}



.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 15px;
    color: #ACAACA;
    line-height: 1.4;
}

.summary-row:last-child {
    margin-bottom: 0;
    font-size: 13px;
}

.summary-row:first-child {
    font-weight: 500;
    color: #fff;
}

.summary-row:first-child span:last-child {
    color: #fff;
    font-weight: 600;
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.btn-payment {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    font-family: Inter;
}

.btn-sbp {
    background: #0047FF;
    color: #FFFFFF;
    font-weight: 600;
}

.btn-sbp:hover {
    background: #1D4ED8;
}

.btn-card {
    background: #0047FF;
    color: white;
    border: none;
}

.btn-card:hover {
    background: #1D4ED8;
}

.btn-payment.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-payment.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: btnPaymentSpin 0.7s linear infinite;
}

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

.payment-info {
    text-align: center;
    margin-top: 32px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.payment-info p {
    margin-bottom: 4px;
}

.payment-info p:first-child {
    margin-bottom: 0;
}

.t-bank-logo {
    margin: 10px 0 20px 0;
    font-weight: 700;
    font-size: 15px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.t-bank-logo::before {
    content: 'Т';
    width: 24px;
    height: 24px;
    background: #FACC15;
    color: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2A2A2E;
    border-radius: 14px;
    padding: 0;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
}

.modal-close {
    display: none;
}

.modal-title {
    font-size: 15px;
    margin: 0;
    padding: 14px 24px 16px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.2px;
    color: #FFFFFF;
    background-color: #141417;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-body {
    margin: 0;
    padding: 18px 24px 20px;
}

.modal-body--centered {
    text-align: left;
    line-height: 1.2;
}

.refund-policy-body {
    font-size: 14px;
}

.refund-policy-body p {
    margin: 0;
}

.refund-policy-body p + p {
    margin-top: 10px;
}

.promo-input,
.code-input {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(157, 157, 157, 0.15) 100%);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 15px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 500;
    transition: all 0.2s;
}

.promo-input:focus,
.code-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(157, 157, 157, 0.20) 100%);
}

.promo-input::placeholder,
.code-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: .4px;
}

.code-input {
    font-size: 15px;
    letter-spacing: 2px;
}

.error-message {
    margin-top: 18px;
    padding: 12px 14px;
    background: transparent;
    border: 1.5px solid #EF4444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #EF4444;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.error-message a {
    color: #60A5FA;
    text-decoration: underline;
}

#errorModal .error-message {
    margin-top: 0;
}

.error-icon {
    font-size: 12px;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #EF4444;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-message {
    margin-top: 18px;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid #22C55E;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #22C55E;
    font-size: 14px;
    line-height: 1.5;
}

.success-message .success-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #22C55E;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-message div {
    flex: 1;
}

.success-message #codeEmail {
    color: #FFFFFF;
    font-weight: 500;
    display: block;
    font-family: Inter;
}

.success-message .resend-link {
    color: #60A5FA;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(96, 165, 250, 0.75);
    display: block;
    margin-top: 8px;
    text-decoration-style: dotted;
}

.resend-link {
    color: #60A5FA;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-style: dotted;
    margin-top: 6px;
    display: block;
}

.resend-link.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-footer {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
    padding: 0;
}

.modal-footer button {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.2px;
    background: transparent;
}

.modal-footer button:first-child {
    border-bottom-left-radius: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer button:last-child {
    border-bottom-right-radius: 16px;
}

#errorModal .modal-footer {
    gap: 0;
}

#errorModal .modal-footer button {
    flex: 1;
}

.btn-primary {
    background: transparent;
    color: #fff;
}

.btn-primary:hover {
    background: #535359;
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
}

.btn-secondary:hover {
    background: #535359;
}

/* Статусы оплаты */
.payment-status {
    padding: 44px 24px 36px;
    text-align: center;
}

/* Анимация штрихкода */
.barcode-animation {
    width: 120px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 18px;
}

.barcode-line {
    width: 4px;
    height: 28px;
    background: #FFFFFF;
    animation: barcodePulse 1.5s ease-in-out infinite;
    opacity: 0.9;
}

.barcode-line:nth-child(1) { animation-delay: 0s; }
.barcode-line:nth-child(2) { animation-delay: 0.1s; }
.barcode-line:nth-child(3) { animation-delay: 0.2s; }
.barcode-line:nth-child(4) { animation-delay: 0.3s; }
.barcode-line:nth-child(5) { animation-delay: 0.4s; }
.barcode-line:nth-child(6) { animation-delay: 0.5s; }
.barcode-line:nth-child(7) { animation-delay: 0.6s; }
.barcode-line:nth-child(8) { animation-delay: 0.7s; }

@keyframes barcodePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.status-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    margin: 0 auto 32px;
    background: rgba(255, 255, 255, 0.1);
}

.success-icon {
    background: #4CAF50;
    color: #FFFFFF;
    font-size: 64px;
    font-weight: 300;
}

.error-icon {
    background: #FF5252;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 300;
}

.payment-status h2 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.payment-status p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    line-height: 1.6;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
}

.payment-status .payment-info p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    font-size: 12px;
}

.status-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 8px;
}

.status-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.2px;
    font-family: Inter;
}

.status-btn--primary {
    background: #0047FF;
    color: #FFFFFF;
    border: none;
    text-decoration: none;
}

.status-btn--bold {
    font-weight: bold;
}

.status-btn--primary:hover {
    background: #1D4ED8;
}

.status-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 400;
}

.status-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.status-btn--link {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-style: dotted;
    padding: 10px 12px;
    margin-top: 15px;
}

.status-btn--link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.btn-link {
    background: none;
    border: none;
    color: #FFFFFF;
    text-decoration: underline;
    cursor: pointer;
    padding: 12px;
    font-size: 16px;
}

.ticket-icon {
    margin-right: 8px;
}

/* Конфетти */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #9C27B0, #00BCD4);
    animation: fall linear;
    animation-duration: 3s;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Адаптивность */
@media (min-width: 481px) and (max-width: 768px) {
    .widget-container {
        max-width: 480px;
        margin: 0 auto;
        border-radius: 10px;
        min-height: auto;
    }

    body {
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .event-poster {
        border-radius: 10px 10px 0 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .poster-image {
        border-radius: 0px;
    }

    .widget-container {
        max-width: 100%;
        border-radius: 0 0 10px 10px;
        /*min-height: 100vh;*/
    }

    .event-poster {
        height: auto;
        border-radius: 0;
    }

    .event-title {
        font-size: 22px;
    }

    .event-artists {
        font-size: 10px;
    }

    .poster-overlay {
        padding: 30px 14px 14px;
    }

    .event-title {
        font-size: 18px;
    }

    .ticket-item {
        padding: 14px 0;
    }

    .ticket-price {
        font-size: 20px;
    }

    .ticket-name {
        font-size: 14px;
    }

    .promo-section {
        padding: 30px 14px 10px 14px;
    }

    .summary-content {
        gap: 12px;
    }

    .btn-continue {
        padding: 11px 20px;
        font-size: 14px;
    }

    .order-details {
        padding: 12px 16px 16px;
    }

    .modal-content {
        margin: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .widget-container {
        border-radius: 0 0 10px 10px;
    }

    .floating-summary {
        left: 0;
        right: 0;
    }

    .poster-image {
        border-radius: 0px;
    }

    .event-poster {
        height: auto;
        border-radius: 0;
    }

    .event-title {
        font-size: 20px;
    }

    .event-artists {
        font-size: 9px;
    }

    .ticket-price {
        font-size: 18px;
    }

    .total-info > span {
        font-size: 20px;
    }

    .logo-container {
        padding: 0px 20px 30px 20px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-text {
        font-size: 14px;
    }

    .toggle-text {
        padding-top: 0px;
        margin-top: -1px;
        line-height: 1.3;
    }

    .success-message #codeEmail {
        display: inline;
    }
}

@media (min-width: 769px) {
    body {
        padding: 40px 20px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        min-height: 100vh;
    }
    
    .widget-container {
        max-width: 480px;
        min-height: auto;
        margin: 0 auto;
        box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
        border-radius: 10px;
    }
    
    .event-poster {
        height: auto;
    }
    
    .logo-container {
        padding: 30px 20px 0px 20px;
    }

    .stage {
        margin-bottom: 0;
    }
}

@media (min-width: 1200px) {
    body {
        padding: 40px 40px;
    }
}

/* ==========================================================================
   Тема "table" (tickets/:event_id/widget/table)

   Встраиваемый виджет без обложки события, с прозрачным фоном и без
   ограничения по высоте. Цвет фона и цвет текста управляются через
   CSS-переменные --widget-bg-color / --widget-text-color (задаются inline
   через ?bg_color=...&text_color=... на стороне контроллера).
   ========================================================================== */

body.theme-table {
    --widget-bg-color: transparent;
    --widget-text-color: #FFFFFF;

    background: var(--widget-bg-color);
    color: var(--widget-text-color);

    min-height: 0;
    height: auto;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;

    /* Пока родительская страница не подстроила высоту iframe под контент (см.
       script.js), допустимо на мгновение оказаться выше содержимого — не даём
       появиться нативному скроллу внутри iframe в этот момент (он сбивает
       раскладку текста и вызывает зацикленный авторесайз, см. theme-table2) */
    overflow-y: hidden;
}

/* Без блюра обложки и без затемняющего градиента поверх — фон полностью прозрачный */
body.theme-table::before,
body.theme-table::after {
    content: none;
    display: none;
}

body.theme-table .widget-container {
    background: var(--widget-bg-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    /* overflow: visible, чтобы .order-summary с position: fixed не обрезался рамкой контейнера */
    overflow: visible;
    /* Контент растягивается на всю ширину виджета, а не ограничен карточкой 480px */
    max-width: 100%;
}

body.theme-table .stage,
body.theme-table .logo-container,
body.theme-table .promo-section {
    max-width: 100%;
}

body.theme-table .logo-container {
    background: var(--widget-bg-color);
}

/* Нижняя панель с кнопкой "Продолжить": пока не выбрано ни одного билета —
   лежит в обычном потоке, как только выбран хотя бы один билет — прилипает
   к нижней границе вьюпорта виджета (position: fixed относительно окна виджета) */
body.theme-table .order-summary {
    position: static;
    background: var(--widget-bg-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.theme-table.has-selection .order-summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0;
    z-index: 500;
}

/* Резервируем внизу страницы место под прилипшую панель, чтобы контент под ней не прятался */
body.theme-table.has-selection {
    padding-bottom: var(--order-summary-height, 88px);
}

/* Много текстовых элементов в основной вёрстке задают цвет напрямую через
   rgba(255,255,255,alpha), а не наследуют color от body — поэтому меняли цвет
   не все. Ниже переопределяем их через --widget-text-color (color-mix сохраняет
   ту же "прозрачность"/иерархию, что и в исходных rgba). Акцентные цвета
   (оранжевое предупреждение, зелёный промокод, текст на цветных кнопках) не
   трогаем — они не должны зависеть от цвета текста виджета. */
body.theme-table .info-label,
body.theme-table .event-details,
body.theme-table .ticket-description {
    color: color-mix(in srgb, var(--widget-text-color) 50%, transparent);
}

body.theme-table .age-restriction {
    color: color-mix(in srgb, var(--widget-text-color) 45%, transparent);
}

body.theme-table .ticket-name {
    color: color-mix(in srgb, var(--widget-text-color) 90%, transparent);
}

body.theme-table .ticket-price.original {
    color: color-mix(in srgb, var(--widget-text-color) 65%, transparent);
}

body.theme-table .ticket-price.discount {
    color: var(--widget-text-color);
}

body.theme-table .quantity-btn {
    color: color-mix(in srgb, var(--widget-text-color) 60%, transparent);
}

body.theme-table .quantity-btn:hover:not(:disabled) {
    color: color-mix(in srgb, var(--widget-text-color) 90%, transparent);
}

body.theme-table .quantity-input {
    color: var(--widget-text-color);
    background: color-mix(in srgb, var(--widget-text-color) 10%, transparent);
}

body.theme-table .total-tickets {
    color: color-mix(in srgb, var(--widget-text-color) 45%, transparent);
}

body.theme-table .total-check {
    color: color-mix(in srgb, var(--widget-text-color) 65%, transparent);
}

body.theme-table .total-check.active {
    color: color-mix(in srgb, var(--widget-text-color) 85%, transparent);
}

body.theme-table .promo-link {
    color: color-mix(in srgb, var(--widget-text-color) 80%, transparent);
    text-decoration-color: color-mix(in srgb, var(--widget-text-color) 32%, transparent);
}

body.theme-table .promo-link:hover {
    color: var(--widget-text-color);
    text-decoration-color: color-mix(in srgb, var(--widget-text-color) 60%, transparent);
}

/* ==========================================================================
   Тема "table2" (tickets/:event_id/widget/table2)

   Выглядит как обычный виджет (обложка, тёмная карточка), но сообщает
   родительской странице свою высоту через postMessage (body[data-auto-height],
   см. script.js), чтобы встраивающий iframe рос вместе с контентом и не
   показывал собственный скролл. Логотип FLAT.AUDIO снизу скрыт.
   ========================================================================== */

body.theme-table2 .logo-container {
    display: none;
}

/* На всех брейкпоинтах базовая вёрстка центрирует контент по вертикали
   (justify-content: center + min-height: 100vh) — для растущего вместе с
   контентом iframe это создаёт огромный пустой отступ сверху/снизу
   (видно на скриншоте пользователя). Отключаем центрирование и задаём
   фиксированный отступ: сверху — 50% от исходных 40px, снизу — столько же. */
body.theme-table2 {
    min-height: 0;
    height: auto;
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 20px;

    /* См. комментарий у body.theme-table — не даём появиться нативному
       скроллу внутри iframe, пока родитель не подстроил его высоту */
    overflow-y: hidden;
}

/* На мобильных обложка должна идти сразу встык, без отступа сверху
   (на десктопе отступ 40px оставляем) */
@media (max-width: 768px) {
    body.theme-table2 {
        padding-top: 0;
    }
}

/* Блюр обложки (см. .bg-blur-wrapper/.bg-blur-image в tickets_widget.html.erb) и
   градиент заданы как position: fixed, т.е. всегда красят весь
   viewport iframe, даже если реального контента меньше — из-за этого
   после отключения центрирования лишняя высота iframe оставалась
   одним пустым куском внизу. Делаем их absolute (body — уже position: relative),
   тогда фон растягивается ровно по высоте контента.

   .bg-blur-image внутри .bg-blur-wrapper намеренно больше своего контейнера
   (чтобы filter: blur() не давал тёмную виньетку по краям) — но сам
   .bg-blur-wrapper от этого не растёт (overflow: hidden просто обрезает лишнее),
   поэтому в отличие от старого transform: scale(1.1) на самом body::before, здесь
   больше не нужен отдельный сброс для table2 — document.body.scrollHeight это
   никак не затрагивает. */
body.theme-table2 .bg-blur-wrapper,
body.theme-table2::after {
    position: absolute;
}

/* Затемняющий градиент внизу должен уходить в чистый чёрный (#000), а не в
   базовый rgba(20,20,23,1) — чтобы бесшовно сливаться с чёрным футером сайта */
body.theme-table2::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
}