:root {
    /* Paleta del logo BEGA Tickets */
    --bega-purple: #6A2C91;
    --bega-purple-deep: #51206F;
    --bega-blue: #2F78B7;
    --bega-blue-deep: #1F5F94;
    --bega-orange: #F15A29;
    --bega-amber: #F7941D;
    --bega-red: #E51B23;
    --bega-green: #009B4A;
    --bega-lime: #8BC53F;
    --bega-ink: #262231;
    --bega-muted: #686273;
    --bega-surface: rgba(255, 255, 255, 0.82);
    --bega-line: rgba(106, 44, 145, 0.16);
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--bega-ink);
    background:
        radial-gradient(ellipse 900px 520px at 8% -8%, rgba(106, 44, 145, 0.28), transparent 58%),
        radial-gradient(ellipse 780px 480px at 96% 4%, rgba(47, 120, 183, 0.26), transparent 55%),
        radial-gradient(ellipse 640px 420px at 70% 100%, rgba(241, 90, 41, 0.16), transparent 50%),
        radial-gradient(ellipse 520px 360px at 10% 90%, rgba(0, 155, 74, 0.12), transparent 48%),
        linear-gradient(165deg, #f7f4fb 0%, #eef5fb 42%, #fff6f0 100%);
    overflow-x: hidden;
}

h1:focus {
    outline: none;
}

.public-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(42px);
    opacity: 0.55;
    animation: drift 14s ease-in-out infinite alternate;
}

.orb-purple {
    width: 280px;
    height: 280px;
    top: 8%;
    left: -60px;
    background: var(--bega-purple);
    animation-delay: 0s;
}

.orb-blue {
    width: 320px;
    height: 320px;
    top: 18%;
    right: -80px;
    background: var(--bega-blue);
    animation-delay: -3s;
}

.orb-orange {
    width: 220px;
    height: 220px;
    bottom: 12%;
    right: 18%;
    background: var(--bega-orange);
    animation-delay: -6s;
}

.orb-green {
    width: 180px;
    height: 180px;
    bottom: 8%;
    left: 12%;
    background: var(--bega-lime);
    animation-delay: -9s;
}

.ring-glow {
    position: absolute;
    top: 42%;
    left: 50%;
    width: min(520px, 70vw);
    height: min(520px, 70vw);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        conic-gradient(
            from 20deg,
            var(--bega-red),
            var(--bega-purple),
            var(--bega-blue),
            var(--bega-green),
            var(--bega-lime),
            var(--bega-amber),
            var(--bega-orange),
            var(--bega-red)
        );
    opacity: 0.09;
    filter: blur(28px);
    animation: spin-slow 48s linear infinite;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1.25rem, 4vw, 3rem) 0.25rem;
    animation: rise-in 480ms ease-out both;
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.login-header-button {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.brand-link {
    display: inline-flex;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: min(188px, 46vw);
    height: auto;
}

.public-main {
    flex: 1;
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 0.25rem clamp(1.25rem, 4vw, 3rem) 3rem;
}

.public-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 2rem;
    color: var(--bega-muted);
    font-size: 0.875rem;
}

.footer-logo {
    width: 110px;
    height: auto;
    opacity: 0.85;
}

.events-hero {
    padding: 1.25rem 0 2rem;
    animation: rise-in 560ms ease-out both;
}

.hero-logo {
    display: block;
    width: min(360px, 82vw);
    height: auto;
    margin: 0 0 1.25rem;
    filter: drop-shadow(0 18px 36px rgba(81, 32, 111, 0.18));
    animation: logo-pop 700ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.events-lead {
    margin: 0;
    max-width: 34rem;
    font-size: clamp(1.1rem, 2.4vw, 1.3rem);
    line-height: 1.45;
    color: var(--bega-muted);
    animation: rise-in 720ms ease-out both;
}

.events-section {
    animation: rise-in 780ms ease-out both;
}

.section-heading-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--bega-purple-deep);
}

.section-accent {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--bega-purple),
        var(--bega-blue),
        var(--bega-orange),
        var(--bega-green)
    );
    opacity: 0.85;
}

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.95rem;
}

.event-list > li {
    animation: rise-in 620ms ease-out both;
    animation-delay: var(--reveal-delay, 0ms);
}

.event-row {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.2rem 1.2rem 1.2rem 1.35rem;
    border: 1px solid var(--bega-line);
    border-radius: 16px;
    background: var(--bega-surface);
    backdrop-filter: blur(10px);
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.event-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(
        180deg,
        var(--bega-purple),
        var(--bega-blue),
        var(--bega-orange)
    );
}

.event-row:hover,
.event-row:focus-visible {
    transform: translateY(-3px) scale(1.01);
    border-color: color-mix(in srgb, var(--bega-purple) 35%, transparent);
    box-shadow:
        0 16px 36px rgba(47, 120, 183, 0.14),
        0 8px 18px rgba(106, 44, 145, 0.1);
    outline: none;
}

.event-row-body {
    flex: 1;
    min-width: 0;
}

.event-name {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--bega-purple-deep);
}

.event-meta {
    margin: 0;
    color: var(--bega-muted);
    font-size: 0.95rem;
}

.meta-sep {
    margin: 0 0.35rem;
}

.event-cta {
    display: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bega-blue);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .event-cta {
        display: inline;
    }
}

.event-chevron {
    color: var(--bega-purple);
    flex-shrink: 0;
}

.state-panel {
    display: grid;
    justify-items: start;
    gap: 0.85rem;
    padding: 1.5rem 0;
    color: var(--bega-muted);
}

.state-panel.hero-state,
.state-panel.detail-state {
    padding-top: 3rem;
    justify-items: center;
    text-align: center;
}

.state-icon {
    font-size: 2.2rem !important;
    color: var(--bega-purple);
}

.state-alert {
    margin-bottom: 1rem;
    max-width: 36rem;
}

.maintenance-panel {
    padding: 2rem 0 3rem;
    text-align: center;
    animation: rise-in 560ms ease-out both;
}

.maintenance-title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--bega-purple-deep);
}

.maintenance-copy {
    margin: 0 auto;
    max-width: 28rem;
    color: var(--bega-muted);
    font-size: 1.1rem;
    line-height: 1.5;
}

.detail-section {
    padding-top: 0.75rem;
    animation: rise-in 480ms ease-out both;
}

.back-link {
    margin-left: -0.5rem;
    margin-bottom: 0.75rem;
}

.detail-header {
    margin-bottom: 1.75rem;
}

.detail-logo {
    display: block;
    width: min(220px, 58vw);
    height: auto;
    margin: 0 0 1.25rem;
    filter: drop-shadow(0 12px 24px rgba(81, 32, 111, 0.14));
}

.detail-title {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.85rem);
    line-height: 1.1;
    color: var(--bega-purple-deep);
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.45rem 0 0;
    color: var(--bega-muted);
}

.detail-block {
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.35rem;
    border-radius: 16px;
    border: 1px solid var(--bega-line);
    background: var(--bega-surface);
    backdrop-filter: blur(8px);
}

.detail-block-title {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--bega-blue-deep);
}

.detail-body {
    margin: 0;
    max-width: 40rem;
    line-height: 1.65;
    color: var(--bega-ink);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logo-pop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(24px, -18px, 0) scale(1.08);
    }
}

@keyframes spin-slow {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb,
    .ring-glow,
    .events-hero,
    .events-section,
    .event-list > li,
    .hero-logo,
    .detail-section,
    .maintenance-panel,
    .public-header {
        animation: none !important;
    }

    .event-row:hover,
    .event-row:focus-visible {
        transform: none;
    }
}

#blazor-error-ui {
    background: #fff8e6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--bega-red);
    padding: 1rem;
    color: white;
}

.registration-section {
    width: min(100%, 640px);
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
    animation: fade-rise 0.55s ease both;
}

.registration-card {
    background: var(--bega-surface);
    border: 1px solid var(--bega-line);
    border-radius: 18px;
    padding: 1.5rem 1.35rem 1.75rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(48, 40, 64, 0.08);
}

.registration-card--success {
    text-align: center;
}

.registration-header {
    text-align: center;
    margin-bottom: 1.35rem;
}

.registration-logo {
    width: min(220px, 58%);
    height: auto;
    margin-bottom: 1rem;
}

.registration-title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.65rem;
    color: var(--bega-ink);
}

.registration-lead {
    margin: 0;
    color: var(--bega-muted);
    font-size: 1.02rem;
    line-height: 1.45;
}

.registration-consents {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.registration-check {
    align-items: flex-start !important;
}

.consent-label {
    display: block;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--bega-ink);
}

.consent-required-mark {
    color: var(--bega-red);
    font-weight: 700;
    margin-left: 0.15rem;
}

@media (max-width: 640px) {
    .registration-card {
        padding: 1.2rem 1rem 1.4rem;
        border-radius: 14px;
    }
}

.login-section {
    max-width: 480px;
}

.welcome-card {
    padding-top: 2rem;
    padding-bottom: 2.25rem;
    animation: fade-rise 0.55s ease both;
}

.welcome-title {
    margin: 0.35rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--bega-purple-deep);
    line-height: 1.25;
}

.welcome-copy {
    margin: 0;
    color: var(--bega-muted);
    font-size: 1.05rem;
    line-height: 1.45;
}

.purchases-section {
    width: min(100%, 920px);
}

.purchases-header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fade-rise 0.55s ease both;
}

.purchases-title {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3.5vw, 2.1rem);
    font-weight: 700;
    color: var(--bega-purple-deep);
    line-height: 1.2;
}

.purchases-lead {
    margin: 0;
    color: var(--bega-muted);
    font-size: 1.05rem;
    line-height: 1.45;
}

.purchases-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.purchase-event-group {
    animation: fade-rise 0.55s ease both;
}

.purchase-event-name {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.6vw, 1.45rem);
    color: var(--bega-ink);
}

.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.purchase-card {
    background: var(--bega-surface);
    border: 1px solid var(--bega-line);
    border-radius: 16px;
    padding: 1.15rem 1.1rem 1.25rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 32px rgba(48, 40, 64, 0.07);
}

.purchase-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.purchase-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
}

.purchase-badge--paid {
    color: #0d5c32;
    background: rgba(0, 155, 74, 0.14);
}

.purchase-badge--reserved {
    color: #8a3b12;
    background: rgba(241, 90, 41, 0.14);
}

.purchase-datetime {
    color: var(--bega-muted);
    font-size: 0.92rem;
}

.purchase-meta {
    margin: 0 0 0.45rem;
    color: var(--bega-ink);
    font-size: 0.95rem;
    line-height: 1.4;
}

.purchase-meta--warning {
    color: #8a3b12;
}

.purchase-meta--muted {
    color: var(--bega-muted);
    margin-top: 0.75rem;
}

.purchase-total {
    margin: 0.65rem 0 0.45rem;
    font-size: 1.05rem;
    color: var(--bega-purple-deep);
}

.purchase-code {
    margin: 0.75rem 0 0.35rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: rgba(106, 44, 145, 0.08);
    border: 1px solid rgba(106, 44, 145, 0.14);
    font-size: 0.95rem;
}

.purchase-code span {
    display: inline-block;
    margin-left: 0.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    word-break: break-all;
}

@media (max-width: 640px) {
    .public-header-actions {
        gap: 0.35rem;
    }

    .login-header-button {
        min-width: 0;
        padding-inline: 0.55rem;
    }
}
