/*
 * Smartcore Anlass Ticket System – Public Booking Page styles.
 * Multi-Step-Wizard mit Event-Card, Kunden-Logo und Ticket-Eingabe.
 *
 * Hinweis: Schriftgroessen sind bewusst grosszuegig gehalten, damit die
 * Buchungsstrecke fuer alle Endkunden sehr gut lesbar ist (auch bei
 * normalem Sitzabstand zum Bildschirm).
 */

.ats-public {
    box-sizing: border-box;
    max-width: 1080px;
    margin: 24px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    line-height: 1.55;
    font-size: 1.0625rem;
}

.ats-public *,
.ats-public *::before,
.ats-public *::after {
    box-sizing: border-box;
}

/* Header: Titel links, Logo rechts. Schlank gehalten. */
.ats-public__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--ats-header-bg, #fff);
    color: var(--ats-title-color, #0f172a);
    padding: var(--ats-header-padding-y, 12px) var(--ats-header-padding-x, 28px);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 2px 18px rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid #e2e8f0;
    min-height: 0;
}

.ats-public__title {
    font-size: var(--ats-title-size, 1.8rem);
    font-weight: var(--ats-title-weight, 800);
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--ats-title-color, #0f172a);
    line-height: 1.1;
}

.ats-public__brand {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: #475569;
    font-size: 1rem;
    max-width: 50%;
    margin-left: auto;
}

.ats-public__brand a,
.ats-public__brand-link {
    display: inline-flex;
    text-decoration: none;
}

.ats-public__brand img {
    max-height: var(--ats-logo-max-height, 54px);
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.ats-public__brand-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f172a;
}

/* Event-Card */
.ats-public__event {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--ats-card-bg, #2b2f33);
    color: var(--ats-event-title-color, #fff);
    border-radius: var(--ats-card-radius, 0);
    overflow: hidden;
    box-shadow: 0 2px 18px rgba(15, 23, 42, 0.08);
}

.ats-public__event-info {
    padding: var(--ats-card-padding-y, 28px) var(--ats-card-padding-x, 32px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ats-public__event-title {
    font-size: var(--ats-event-title-size, 2rem);
    font-weight: var(--ats-event-title-weight, 700);
    margin: 0 0 4px;
    color: var(--ats-event-title-color, #fff);
    line-height: 1.2;
}

.ats-public__event-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--ats-meta-color, rgba(255, 255, 255, 0.92));
    font-size: var(--ats-meta-size, 1.125rem);
    font-weight: var(--ats-meta-weight, 400);
}

.ats-public__event-meta li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ats-public__event-meta svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: var(--ats-icon-color, rgba(255, 255, 255, 0.85));
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ats-public__event-image {
    background: #1f2225 center/cover no-repeat;
    min-height: 320px;
}

.ats-public__event--no-image {
    grid-template-columns: minmax(0, 1fr);
}

.ats-public__event-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
}

/* Beschreibung des Events – verkaufsentscheidender Text, daher gross. */
.ats-public__event-description {
    margin: 18px 0 0;
    color: var(--ats-desc-color, rgba(255, 255, 255, 0.92));
    font-size: var(--ats-desc-size, 1.25rem);
    font-weight: var(--ats-desc-weight, 400);
    line-height: 1.6;
}

.ats-public__event-description p {
    margin: 0 0 10px;
}

.ats-public__event-description p:last-child {
    margin-bottom: 0;
}

/* Steps */
.ats-public__steps {
    background: #f1f3f5;
    border-radius: 0 0 14px 14px;
    padding: 26px 30px 30px;
    box-shadow: 0 2px 18px rgba(15, 23, 42, 0.08);
}

.ats-public__form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ats-public__step {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
    margin-top: 16px;
}

.ats-public__step:first-of-type {
    margin-top: 0;
}

.ats-public__step[hidden] {
    display: none !important;
}

.ats-public__step-title {
    margin: 0 0 18px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.ats-public__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.ats-public__field-label {
    font-size: 1.0625rem;
    color: #1e293b;
    font-weight: 600;
}

/*
 * Visuell verstecktes Label (nur fuer Screenreader). Wird in Step 2/3
 * verwendet, weil die Eingabefelder selbst sprechende Placeholder haben.
 */
.ats-public__field-label--sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ats-public__field-hint {
    margin: 6px 0 0;
    font-size: 1rem;
    color: #64748b;
}

.ats-public__input,
.ats-public__select,
.ats-public__textarea {
    appearance: none;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 1.0625rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.4;
}

.ats-public__input:focus,
.ats-public__select:focus,
.ats-public__textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ats-public__qty-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
}

.ats-public__qty-row .ats-public__price {
    font-size: 1.2rem;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.ats-public__total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 18px 0 6px;
    font-size: 1.2rem;
    color: #0f172a;
}

.ats-public__total-value {
    font-weight: 700;
}

.ats-public__divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 18px 0;
}

.ats-public__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.ats-public__nav .ats-public__nav-spacer {
    flex: 1 1 auto;
}

.ats-public__btn {
    appearance: none;
    border: 0;
    background: #6c757d;
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.ats-public__btn:hover {
    background: #5c6168;
}

.ats-public__btn:active {
    transform: translateY(1px);
}

.ats-public__btn--primary {
    background: var(--ats-accent-bg, #0f172a);
    color: var(--ats-accent-text, #fff);
}

.ats-public__btn--primary:hover {
    filter: brightness(0.92);
}

.ats-public__btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/*
 * Layout-Grid fuer Formular-Schritte (Step 2 – Rechnungsangaben):
 * 12-Spalten-Grid; Felder bekommen Spaltenbreite ueber span-Modifier.
 * Auf Mobile reduziert sich auf eine Spalte.
 */
.ats-public__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px 16px;
}

.ats-public__field--span-3  { grid-column: span 3; }
.ats-public__field--span-4  { grid-column: span 4; }
.ats-public__field--span-6  { grid-column: span 6; }
.ats-public__field--span-9  { grid-column: span 9; }
.ats-public__field--span-12 { grid-column: span 12; }

.ats-public__attendees {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ats-public__attendee {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px 20px;
    background: #f8fafc;
}

.ats-public__attendee-title {
    font-weight: 700;
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 1.15rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* Personalien-Felder bekommen ein robustes Auto-Fit-Grid: keine
 * unleserlich gequetschten Spalten mehr, sondern mind. 220px pro Feld. */
.ats-public__attendee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
}
.ats-public__attendee-grid .ats-public__field {
    min-width: 0;
}
.ats-public__attendee-grid .ats-public__field--email {
    grid-column: 1 / -1;
}

.ats-public__alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 14px;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.ats-public__alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.ats-public__alert--info {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ats-public__progress {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    list-style: none;
    padding: 0;
}

.ats-public__progress li {
    flex: 1 1 0;
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.ats-public__progress li.is-active,
.ats-public__progress li.is-done {
    background: #0f172a;
}

/* Summary (Step 4) */
.ats-public__summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0 14px;
}

.ats-public__summary-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
}

.ats-public__summary-block h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
}

.ats-public__summary-block p {
    margin: 0;
    color: #0f172a;
    line-height: 1.55;
    font-size: 1.0625rem;
}

.ats-public__summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #0f172a;
    font-size: 1.0625rem;
}

.ats-public__summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Legal Notice (AGB / Datenschutz) */
.ats-public__legal {
    margin: 16px 0 4px;
    padding: 16px 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.6;
}

.ats-public__legal p {
    margin: 0;
}

.ats-public__legal p + p {
    margin-top: 10px;
}

.ats-public__legal a {
    color: #1d4ed8;
    text-decoration: underline;
}

.ats-public__legal a:hover {
    color: #1e40af;
}

@media (max-width: 860px) {
    .ats-public__field--span-3,
    .ats-public__field--span-4,
    .ats-public__field--span-6,
    .ats-public__field--span-9 {
        grid-column: span 12;
    }
}

@media (max-width: 720px) {
    .ats-public {
        margin: 0;
        max-width: 100%;
        font-size: 1rem;
    }
    .ats-public__header,
    .ats-public__event,
    .ats-public__steps {
        border-radius: 0;
    }
    .ats-public__header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 18px;
    }
    .ats-public__brand {
        max-width: 50%;
        justify-content: flex-end;
    }
    .ats-public__brand img {
        max-height: 44px;
        max-width: 140px;
    }
    .ats-public__title {
        font-size: 1.4rem;
    }
    .ats-public__event {
        grid-template-columns: 1fr;
    }
    .ats-public__event-image {
        order: -1;
        min-height: 220px;
    }
    .ats-public__event-info,
    .ats-public__steps {
        padding: 20px;
    }
    .ats-public__event-title {
        font-size: 1.55rem;
    }
    .ats-public__event-description {
        font-size: 1.1rem;
    }
    .ats-public__step {
        padding: 18px;
    }
    .ats-public__step-title {
        font-size: 1.3rem;
    }
    .ats-public__summary-total {
        font-size: 1.15rem;
        padding: 14px 16px;
    }
}

/* =========================================================
 * Rechnung (renderInvoice)
 * Zweispaltiger Briefkopf, Empfänger-Adresse, Positionstabelle.
 * ========================================================= */
.ats-invoice {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 32px;
    color: #0f172a;
    font-size: 1.0625rem;
    line-height: 1.55;
}
.ats-invoice__head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-start;
    gap: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 18px;
    margin-bottom: 18px;
}
.ats-invoice__logo {
    display: flex;
    align-items: center;
}
.ats-invoice__logo img {
    max-height: 80px;
    max-width: 260px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.ats-invoice__sender-name {
    font-size: 1.4rem;
    font-weight: 700;
}
.ats-invoice__sender {
    font-style: normal;
    text-align: right;
    color: #1e293b;
    font-size: 0.98rem;
    line-height: 1.5;
}
.ats-invoice__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 12px 0 18px;
}
.ats-invoice__buyer {
    font-style: normal;
    line-height: 1.55;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}
.ats-invoice__buyer small {
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}
.ats-invoice__facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 14px;
    row-gap: 6px;
    align-self: start;
    margin: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}
.ats-invoice__facts dt { color: #64748b; margin: 0; font-weight: 600; }
.ats-invoice__facts dd { margin: 0; font-weight: 500; }
.ats-invoice__title {
    margin: 8px 0 6px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.ats-invoice__subject {
    margin: 0 0 16px;
    color: #1e293b;
}
.ats-invoice__items {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 14px;
}
.ats-invoice__items th,
.ats-invoice__items td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
.ats-invoice__items thead th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ats-invoice__items tfoot th {
    text-align: right;
    background: #0f172a;
    color: #fff;
    font-size: 1.05rem;
}
.ats-invoice__items tfoot th:last-child { text-align: left; }
.ats-invoice__col-pos { width: 56px; }
.ats-invoice__col-qty,
.ats-invoice__col-unit,
.ats-invoice__col-total { width: 130px; white-space: nowrap; }
.ats-invoice__terms {
    margin: 14px 0 8px;
    padding: 10px 14px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    color: #78350f;
}
.ats-invoice__refund {
    margin: 10px 0;
    color: #991b1b;
}
.ats-invoice__notice {
    margin: 14px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
}
.ats-invoice__notice--warn {
    background: #fef2f2;
    color: #991b1b;
}
.ats-invoice__footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}
@media (max-width: 720px) {
    .ats-invoice {
        padding: 18px 16px;
    }
    .ats-invoice__head,
    .ats-invoice__meta {
        grid-template-columns: 1fr;
    }
    .ats-invoice__sender {
        text-align: left;
    }
    .ats-invoice__items thead {
        display: none;
    }
    .ats-invoice__items tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 10px;
        padding: 8px 0;
        border-bottom: 1px solid #e2e8f0;
    }
    .ats-invoice__items td {
        border: 0;
        padding: 4px 0;
    }
    .ats-invoice__col-pos { display: none; }
    .ats-invoice__col-desc { grid-column: 1 / -1; font-weight: 600; }
}
@media print {
    .ats-invoice {
        border: 0;
        padding: 0;
        box-shadow: none;
    }
    .ats-invoice__items thead th { background: #e2e8f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ats-invoice__items tfoot th { background: #0f172a !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ats-invoice__terms { background: #fff !important; border-left: 4px solid #000 !important; color: #000 !important; }
}
