/* =============================================================================
   Event Ticket Referral — Stili frontend
   Allineati alla pagina Contatti (gradiente-brand):
   - Sfondo: linear-gradient(360deg, #250b58, #6707ac)
   - Testo: bianco
   - Input: trasparenti, outline 2px solid white, border-radius 2em
   - Font: Open Sans (corpo), Montserrat 800 uppercase (titoli/btn)
   ============================================================================= */

/* ── Variabili locali ─────────────────────────────────────────────────────── */
:root {
    --evtix-primary:      #250b58;
    --evtix-secondary:    #6707ac;
    --evtix-gradient:     360deg, #250b58 0%, #6707ac 100%;
    --evtix-btn-bg:       #d0444a;
    --evtix-btn-hover:    #f0a532;
    --evtix-green:        #10b981;
    --evtix-font-body:    "Open Sans", Helvetica, Arial, Verdana, sans-serif;
    --evtix-font-title:   "Montserrat", Helvetica, Arial, Verdana, sans-serif;
    --evtix-white-10:     rgba(255, 255, 255, 0.10);
    --evtix-white-20:     rgba(255, 255, 255, 0.20);
    --evtix-white-30:     rgba(255, 255, 255, 0.30);
    --evtix-white-70:     rgba(255, 255, 255, 0.70);
    --evtix-white-90:     rgba(255, 255, 255, 0.90);
}

/* ── Wrapper principale ───────────────────────────────────────────────────── */
.evtix-referral-wrap {
    max-width: 780px;
    font-family: var(--evtix-font-body);
    background: linear-gradient(var(--evtix-gradient));
    padding: 40px 32px;
    color: #fff;
}

/* ── Card base ────────────────────────────────────────────────────────────── */
.evtix-card {
    background: var(--evtix-white-10);
    border: 1px solid var(--evtix-white-20);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 20px;
}

.evtix-card__title {
    font-family: var(--evtix-font-title) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
}

.evtix-card__subtitle {
    font-size: 14px;
    color: var(--evtix-white-70);
    margin: 0 0 20px !important;
}

.evtix-card__subtitle:has(+ .evtix-card__notice) {
    margin-bottom: 4px !important;
}

.evtix-card__subtitle + .evtix-card__notice {
    margin-top: 0 !important;
}

.evtix-card__notice {
    font-size: 14px !important;
    color: var(--evtix-white-70);
    margin: 0 0 20px !important;
}

/* ── Banner "Obiettivo Raggiunto" ─────────────────────────────────────────── */
.evtix-success-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.50);
    border-radius: 0;
    padding: 20px 24px;
    margin-bottom: 20px;
    color: #fff;
    animation: evtix-glow 2.5s ease-in-out infinite;
}

@keyframes evtix-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
    50%       { box-shadow: 0 4px 32px rgba(255, 255, 255, 0.25); }
}

.evtix-success-icon {
    font-size: 38px;
    flex-shrink: 0;
    line-height: 1;
}

.evtix-success-banner strong {
    display: block;
    font-family: var(--evtix-font-title);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 4px;
    color: #fff;
}

.evtix-success-banner p {
    margin: 0 !important;
    font-size: 14px;
    color: var(--evtix-white-90);
}

/* ── Link di referral ─────────────────────────────────────────────────────── */
.evtix-link-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* Etichetta tra i due campi — stesso stile di .evtix-card__subtitle */
.evtix-link-sublabel {
    margin: 24px 0 20px !important;
    font-size: 14px !important;
    color: var(--evtix-white-70) !important;
}

/* Input solo-codice: stessa larghezza del link, font monospace per leggibilità */
.evtix-referral-wrap input.evtix-link-input--code {
    font-family: 'Courier New', monospace !important;
    letter-spacing: .18em !important;
}

.evtix-referral-wrap input.evtix-link-input,
.evtix-referral-wrap input.evtix-link-input[type="text"],
.evtix-referral-wrap input.evtix-link-input[readonly] {
    flex: 1;
    min-width: 0;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    outline: 2px solid rgba(255, 255, 255, 0.70) !important;
    border-radius: 2em !important;
    padding: 11px 20px !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #fff !important;
    font-family: var(--evtix-font-body) !important;
    font-weight: bold !important;
    cursor: text;
    transition: outline-color .2s;
    box-sizing: border-box !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    width: auto !important;
}

.evtix-referral-wrap input.evtix-link-input::placeholder {
    color: rgba(255, 255, 255, 0.60) !important;
    font-weight: bold !important;
}

.evtix-referral-wrap input.evtix-link-input:focus {
    outline: 2px solid #fff !important;
    box-shadow: none !important;
    background-color: transparent !important;
    color: #fff !important;
}

/* Bottone "Copia" — sfondo bianco su gradiente */
.evtix-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--evtix-primary) !important;
    border: none;
    border-radius: 50px;
    padding: 11px 22px;
    font-family: var(--evtix-font-title);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .2s, color .2s, transform .1s;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.evtix-copy-btn:hover {
    background: var(--evtix-btn-hover);
    color: #fff !important;
}

.evtix-copy-btn:active {
    transform: scale(.97);
}

.evtix-copy-btn.is-copied {
    background: var(--evtix-green);
    color: #fff !important;
}

/* ── Slot circolari — snake layout ───────────────────────────────────────── */

/*
 * Gli slot sono raggruppati in righe (.evtix-slots__row).
 * Le righe pari vanno sinistra→destra, quelle dispari destra→sinistra (flex-direction: row-reverse).
 * Il connettore verticale tra le righe (.evtix-slots__vconn) è posizionato
 * in corrispondenza del cerchio dell'ultimo slot della riga.
 * I connettori orizzontali sono mezze-linee ::before/::after dentro ogni slot.
 */

.evtix-slots {
    --evtix-slots-per-row: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0 auto 20px;
    width: 100%;
}

/* ── Riga di slot ─────────────────────────────────────────────────────────── */
.evtix-slots__row {
    display: flex;
    flex-direction: row;
    width: 100%;
}
.evtix-slots__row--reverse {
    flex-direction: row-reverse;
}

/* ── Singolo slot ─────────────────────────────────────────────────────────── */
.evtix-slot {
    --evtix-circle: 72px;
    flex: 0 0 calc(100% / var(--evtix-slots-per-row));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Mezze-linee orizzontali: ::before (sinistra), ::after (destra) del box slot */
.evtix-slot::before,
.evtix-slot::after {
    content: '';
    position: absolute;
    top: calc(var(--evtix-circle) / 2);
    transform: translateY(-50%);
    width: calc(50% - var(--evtix-circle) / 2);
    height: 3px;
    background: var(--evtix-white-20);
}
.evtix-slot::before { left: 0; }
.evtix-slot::after  { right: 0; }

/* ── Connettori: bordi esterni nascosti ───────────────────────────────────── */
/* Riga normale: primo slot → no connettore sinistro; ultimo → no connettore destro */
.evtix-slots__row:not(.evtix-slots__row--reverse) .evtix-slot:first-child::before { display: none; }
.evtix-slots__row:not(.evtix-slots__row--reverse) .evtix-slot:last-child::after   { display: none; }
/* Riga invertita: il primo DOM è il più a destra visualmente */
.evtix-slots__row--reverse .evtix-slot:first-child::after  { display: none; }
.evtix-slots__row--reverse .evtix-slot:last-child::before  { display: none; }

/* ── Connettori: stato completato ─────────────────────────────────────────── */
/* Riga normale (sinistra→destra): ::after dello slot pieno + ::before del successivo */
.evtix-slots__row:not(.evtix-slots__row--reverse) .evtix-slot--filled::after               { background: rgba(255,255,255,0.65); }
.evtix-slots__row:not(.evtix-slots__row--reverse) .evtix-slot--filled + .evtix-slot::before { background: rgba(255,255,255,0.65); }
/* Riga invertita (destra→sinistra): ::before dello slot pieno + ::after del successivo DOM */
.evtix-slots__row--reverse .evtix-slot--filled::before               { background: rgba(255,255,255,0.65); }
.evtix-slots__row--reverse .evtix-slot--filled + .evtix-slot::after  { background: rgba(255,255,255,0.65); }

/* ── Cerchio ──────────────────────────────────────────────────────────────── */
.evtix-slot__circle {
    /* La larghezza si adatta alla larghezza dello slot; l'altezza segue via aspect-ratio */
    width: min(var(--evtix-circle), calc(100% - 8px));
    aspect-ratio: 1;
    height: auto;
    border-radius: 50%;
    border: 2px solid var(--evtix-white-30);
    background: var(--evtix-white-10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--evtix-font-title);
    font-size: clamp(12px, 4vw, 22px);
    font-weight: 800;
    color: var(--evtix-white-70);
    transition: all .4s ease;
    flex-shrink: 0;
}

.evtix-slot__circle svg {
    width: min(26px, 55%);
    height: min(26px, 55%);
}

.evtix-slot--filled .evtix-slot__circle {
    background: #fff;
    border-color: #fff;
    color: var(--evtix-primary);
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.25);
    animation: evtix-slot-pop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes evtix-slot-pop {
    0%   { transform: scale(.7); opacity: .4; }
    100% { transform: scale(1);  opacity: 1;  }
}

.evtix-slot__label {
    font-family: var(--evtix-font-title);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--evtix-white-70);
    text-align: center;
    white-space: nowrap;
}

.evtix-slot--filled .evtix-slot__label {
    color: #fff;
}

/* ── Connettore verticale tra le righe ────────────────────────────────────── */
.evtix-slots__vconn {
    width: 100%;
    height: 20px;
    position: relative;
}

.evtix-slots__vconn::after {
    content: '';
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--evtix-white-20);
    transform: translateX(-50%);
}

/* Posizionato al centro del cerchio dell'ultimo slot della riga */
.evtix-slots__vconn--right::after {
    left: calc(100% - 100% / var(--evtix-slots-per-row) / 2);
}
.evtix-slots__vconn--left::after {
    left: calc(100% / var(--evtix-slots-per-row) / 2);
}

.evtix-slots__vconn--filled::after {
    background: rgba(255, 255, 255, 0.65);
}

/* ── Barra di avanzamento ─────────────────────────────────────────────────── */
.evtix-progress {
    background: var(--evtix-white-20);
    border-radius: 2em;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.evtix-progress__bar {
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 2em;
    transition: width .9s cubic-bezier(.25, 1, .5, 1);
}

.evtix-progress__label {
    font-size: 13px;
    color: var(--evtix-white-70);
    text-align: center;
    margin: 0 !important;
}

/* ── Tabella amici ────────────────────────────────────────────────────────── */
.evtix-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.evtix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #fff;
}

.evtix-table th {
    text-align: left;
    padding: 10px 14px;
    font-family: var(--evtix-font-title);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.50);
    white-space: nowrap;
}

.evtix-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--evtix-white-10);
    vertical-align: middle;
    color: var(--evtix-white-90);
}

.evtix-table tr:last-child td {
    border-bottom: none;
}

.evtix-table tbody tr:hover td {
    background: var(--evtix-white-10);
}

.evtix-table__email {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
}

/* ── Badge stati ordine ───────────────────────────────────────────────────── */
.evtix-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 50px;
    font-family: var(--evtix-font-title);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.evtix-badge--completed {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    outline: 1px solid rgba(16, 185, 129, 0.50);
}

.evtix-badge--processing {
    background: rgba(59, 130, 246, 0.20);
    color: #93c5fd;
    outline: 1px solid rgba(59, 130, 246, 0.40);
}

.evtix-badge--pending,
.evtix-badge--pending-payment {
    background: rgba(245, 158, 11, 0.20);
    color: #fcd34d;
    outline: 1px solid rgba(245, 158, 11, 0.40);
}

.evtix-badge--on-hold {
    background: var(--evtix-white-10);
    color: var(--evtix-white-70);
    outline: 1px solid var(--evtix-white-20);
}

.evtix-badge--cancelled,
.evtix-badge--failed,
.evtix-badge--refunded {
    background: rgba(239, 68, 68, 0.20);
    color: #fca5a5;
    outline: 1px solid rgba(239, 68, 68, 0.40);
}

.evtix-badge--none {
    background: var(--evtix-white-10);
    color: var(--evtix-white-70);
    outline: 1px solid var(--evtix-white-20);
}

/* ── Stato vuoto ──────────────────────────────────────────────────────────── */
.evtix-empty {
    text-align: center;
    padding: 32px 16px;
}

.evtix-empty svg {
    display: block;
    margin: 0 auto 12px;
    stroke: rgba(255, 255, 255, 0.30);
}

.evtix-empty p {
    color: var(--evtix-white-70);
    font-size: 14px;
    margin: 0 !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .evtix-referral-wrap {
        padding: 24px 16px;
    }

    .evtix-card {
        padding: 16px;
    }

    .evtix-link-row {
        flex-direction: column;
    }

    .evtix-copy-btn {
        width: 100%;
        justify-content: center;
    }

    .evtix-slot {
        --evtix-circle: 52px;
    }

    .evtix-slot__circle {
        font-size: 16px;
    }

    .evtix-slot__label {
        font-size: 9px;
    }

    .evtix-slots__vconn {
        height: 14px;
    }

    .evtix-success-banner {
        flex-direction: column;
        text-align: center;
    }
}
