/* assets/css/register.css - TEMA 2026 - COMPLETO DEFINITIVO CON FIX CENTRAMENTO MOBILE */
/* Card FUT vivono in fut-card.css, qui c'è tutto il resto. */

/* =========================================
   1. FONTS E VARIABILI
   ========================================= */
@font-face {
    font-family: 'DrukWide';
    src: url('/assets/doc/DrukTextWide-MediumItalic-Trial.otf') format('opentype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'HelveticaBold';
    src: url('/assets/doc/HelveticaBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --rosa-elettrico: #ff19ff;
    --viola: #790cfd;
    --vinaccia: #120028;
    --bianco: #ffffff;
    --sfondo-scuro: rgba(18, 0, 40, 0.85);
    --sfondo-box: rgba(18, 0, 40, 0.6);
    --bordo-sottile: 1px solid rgba(255, 25, 255, 0.3);
}

/* =========================================
   2. FORM REGISTRAZIONE
   ========================================= */

/* Blocca scroll orizzontale su mobile — il campo può sforare ma non si scorre */
html {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    overflow-x: hidden;
    max-width: 100%;
    touch-action: pan-y; /* solo scroll verticale, no swipe laterale */
    overscroll-behavior-x: none;
}

main {
    max-width: 500px;
    margin: auto;
    font-family: 'HelveticaBold', sans-serif;
    color: var(--bianco);
}

#step2, #step3 { display: none; }

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 13px;
}

.input-row label {
    flex-basis: 80px;
    margin-right: 7px;
    font-family: 'DrukWide', sans-serif;
    font-size: 0.54rem;
    color: var(--rosa-elettrico);
    text-transform: uppercase;
}

.input-row input { flex-grow: 1; }

input[type="text"],
input[type="password"],
input[type="email"] {
    margin-top: 3px;
    padding: 7px 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 25, 255, 0.5);
    border-radius: 4px;
    color: var(--bianco);
    font-family: 'HelveticaBold', sans-serif;
    font-size: 16px; /* 16px minimo per prevenire auto-zoom su iOS/Android */
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: var(--rosa-elettrico);
    box-shadow: 0 0 7px rgba(255, 25, 255, 0.4);
    background-color: rgba(255, 25, 255, 0.1);
}

#user-image-container,
#team-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

#preview,
#preview2 {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 3px;
    border: 1px solid var(--rosa-elettrico);
}

#select-image,
#select-image2 {
    width: 13px;
    height: 13px;
    cursor: pointer;
}

/* =========================================
   3. CAMPO TRAPEZOIDALE (PC / DESKTOP - PERFETTO)
   ========================================= */
.campo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 13px 0;
    position: relative;
    overflow: visible;
    padding: 20px 30px;
}

.campo-calcio {
    width: 650px;
    height: 860px;
    position: relative;
    margin: 0;
    overflow: visible;
    background: transparent;
}

.campo-calcio::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/assets/imm/campettofanta.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

.campo-calcio::after {
    content: none;
}

/* =========================================
   4. SLOT POSIZIONE (1-1-2-1)
   ========================================= */
.posizione {
    position: absolute;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    z-index: 5;
    box-sizing: border-box;

    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(1px);
}

.posizione:hover {
    border-color: var(--rosa-elettrico);
    background: rgba(255, 25, 255, 0.15);
}

.posizione.selezionato {
    border: none;
    background: transparent;
    backdrop-filter: none;
    width: 140px;
    height: 140px;
}

.posizione .add-icon {
    font-size: 22px;
    color: white;
    font-weight: bold;
    opacity: 0.7;
}

.posizione.selezionato .add-icon { display: none; }

/* ⚽ POSIZIONI DEI 5 TITOLARI SUL CAMPO - DESKTOP */
.portiere    { bottom: 190px; left: 50%; transform: translateX(-50%); }
.difensore   { bottom: 370px; left: 50%; transform: translateX(-50%); }
.laterale-sx { bottom: 510px; left: 90px; }
.laterale-dx { bottom: 510px; right: 90px; }
.pivot       { top: 130px;    left: 50%; transform: translateX(-50%); }

.portiere.selezionato,
.difensore.selezionato,
.pivot.selezionato {
    transform: translateX(-50%);
}

.portiere:hover,
.difensore:hover,
.pivot:hover {
    transform: translateX(-50%) scale(1.04);
}

.laterale-sx:hover,
.laterale-dx:hover {
    transform: scale(1.04);
}

/* =========================================
   5. MODAL SCELTA GIOCATORI
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(18, 0, 40, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #120028;
    margin: 5% auto;
    padding: 13px;
    border-radius: 7px;
    width: 80%;
    max-width: 402px;
    max-height: 55vh;
    overflow-y: auto;
    color: white;
    border: 1px solid var(--rosa-elettrico);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.6);
}

.close {
    color: var(--rosa-elettrico);
    float: right;
    font-size: 19px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: white; }

.players-list {
    max-height: 268px;
    overflow-y: scroll;
    margin-top: 7px;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 7px;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background 0.3s;
}

.team-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 7px 6px 7px;
    margin-top: 4px;
    border-bottom: 1px solid rgba(255, 25, 255, 0.3);
    text-transform: uppercase;
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    color: var(--rosa-elettrico);
    position: sticky;
    top: 0;
    background: #120028;
    z-index: 2;
}

.team-group-header img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.team-group-header:first-child {
    margin-top: 0;
    padding-top: 6px;
}

.player-item:hover { background: rgba(255, 25, 255, 0.15); }

.player-item__pic {
    width: 34px !important;
    height: 34px !important;
    border-radius: 0 !important;
    margin-right: 10px;
    border: none !important;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.player-info {
    flex-grow: 1;
    font-size: 0.74rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}
.player-info strong {
    font-size: 0.8rem;
    color: var(--bianco);
    text-transform: uppercase;
}
.player-info small {
    font-size: 0.64rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.player-item__value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 3px 8px;
    background: transparent;
    border: none;
    color: var(--bianco);
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.player-item__crest {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain;
    margin-left: 8px;
    flex-shrink: 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent;
}

.player-item.is-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}
.player-item.is-disabled .player-item__value {
    background: rgba(255, 25, 255, 0.05);
    border-color: rgba(255, 25, 255, 0.15);
}

.search-container { margin-bottom: 10px; }
.search-container input {
    width: 100%;
    padding: 7px;
    border: 1px solid rgba(255, 25, 255, 0.5);
    border-radius: 3px;
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 16px; /* 16px minimo per prevenire auto-zoom su iOS/Android */
}

/* =========================================
   6. MODAL AZIONI (Cambia / Capitano)
   ========================================= */
#actionModal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(18, 0, 40, 0.85);
}

.action-modal-content {
    background-color: #120028;
    margin: 20% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 235px;
    text-align: center;
    color: white;
    border: 1px solid var(--rosa-elettrico);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.8);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 17px;
}

.action-button {
    padding: 8px 17px;
    border: none;
    border-radius: 17px;
    font-size: 0.67rem;
    font-family: 'HelveticaBold', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.action-button.cambiarlo {
    background: transparent;
    color: white;
    border: 1px solid var(--rosa-elettrico);
}
.action-button.cambiarlo:hover {
    background: rgba(255, 25, 255, 0.2);
    transform: translateY(-2px);
}

.action-button.capitano {
    background: linear-gradient(135deg, var(--rosa-elettrico), var(--viola));
    color: white;
}
.action-button.capitano:hover {
    box-shadow: 0 4px 13px rgba(255, 25, 255, 0.5);
    transform: translateY(-2px);
}

/* =========================================
   7. PANCHINA (Incollata al campo)
   ========================================= */
.panchina-container { 
    margin: 0px 0 20px 0; 
}

.panchina {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    background: var(--sfondo-box);
    padding: 16px;
    border-radius: 8px;
    border: var(--bordo-sottile);
}

.panchina-slot {
    width: 90px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;

    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s, background 0.3s, border-color 0.3s;
}

.panchina-slot:hover {
    border-color: var(--rosa-elettrico);
    background: rgba(255, 25, 255, 0.15);
    transform: scale(1.04);
}

.panchina-slot.selezionato {
    border: none;
    background: transparent;
    width: 140px;
    height: 140px;
}

.panchina-slot .add-icon {
    font-size: 22px;
    color: white;
    font-weight: bold;
    opacity: 0.7;
}

.panchina-slot.selezionato .add-icon { display: none; }

/* =========================================
   8. CAPITANO
   ========================================= */
.capitano-container { margin: 13px 0; text-align: center; }

.capitano-selected {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    background: var(--sfondo-scuro);
    border: 1px solid var(--rosa-elettrico);
    border-radius: 7px;
    color: white;
    margin: 7px 0;
    font-size: 0.67rem;
    text-transform: uppercase;
}

.capitano-selected img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin-right: 7px;
    object-fit: contain;
    border: 1px solid rgba(255, 25, 255, 0.5);
    background: transparent;
}

/* =========================================
   9. BOTTONE SALVA
   ========================================= */
.bottone-salva {
    background: linear-gradient(135deg, var(--rosa-elettrico), var(--viola));
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 17px;
    font-size: 0.74rem;
    font-family: 'DrukWide', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 25, 255, 0.3);
    margin-top: 10px;
}
.bottone-salva:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 13px rgba(255, 25, 255, 0.5);
}

/* =========================================
   10. JERSEY SLOT (Desktop / PC)
   ========================================= */
.jersey-slot {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    overflow: visible;
}

.jersey-img {
    display: block;
    width: 115px;
    height: 115px;
    object-fit: contain;
    margin: 0 auto;
    flex-shrink: 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent;
    position: relative;
    z-index: 1;
}

.jersey-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    padding: 3px 8px 4px 8px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 25, 255, 1);
    border-radius: 5px;
    white-space: nowrap;
    min-width: 92px;
    max-width: 125px;
    box-sizing: border-box;
    line-height: 1.25;
    text-align: center;
    position: relative;
    z-index: 2;
}

.jersey-role {
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.55rem;
    color: #ff19ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.jersey-name {
    font-family: 'HelveticaBold', Arial, sans-serif;
    font-size: 0.62rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.jersey-value {
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.7rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jersey-badge-cap {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rosa-elettrico), var(--viola));
    color: #fff;
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px rgba(255, 25, 255, 0.7);
    z-index: 10;
    pointer-events: none;
}

.posizione.selezionato,
.panchina-slot.selezionato {
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   11. BUDGET WIDGET
   ========================================= */
.budget-widget {
    margin: 0 0 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(18, 0, 40, 0.7);
    border: 1px solid rgba(255, 25, 255, 0.3);
    font-family: 'HelveticaBold', sans-serif;
    color: var(--bianco);
    position: sticky;
    top: 8px;
    z-index: 20;
    backdrop-filter: blur(6px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.budget-widget__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.budget-widget__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.72rem;
    color: var(--rosa-elettrico);
    text-transform: uppercase;
}
.budget-widget__label i { font-size: 0.85rem; }

.budget-widget__values {
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--bianco);
}
.budget-widget__sep {
    opacity: 0.5;
    margin: 0 3px;
}

.budget-widget__bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 25, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.budget-widget__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rosa-elettrico), var(--viola));
    border-radius: 3px;
    transition: width 0.35s ease, background 0.3s ease;
}

.budget-widget__footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    opacity: 0.85;
}
.budget-widget__footer strong {
    font-family: 'DrukWide', sans-serif;
    font-style: italic;
    font-size: 0.78rem;
    color: var(--bianco);
}

.budget-widget.is-warning { border-color: rgba(255, 180, 0, 0.5); }
.budget-widget.is-warning .budget-widget__bar-fill { background: linear-gradient(90deg, #ffb400, #ff19ff); }
.budget-widget.is-danger { border-color: rgba(255, 60, 60, 0.6); box-shadow: 0 0 14px rgba(255, 60, 60, 0.3); }
.budget-widget.is-danger .budget-widget__bar-fill { background: linear-gradient(90deg, #ff3c3c, #ff19ff); width: 100% !important; }
.budget-widget.is-danger #budget-remaining { color: #ff6060; }
.budget-widget.is-full { border-color: rgba(121, 12, 253, 0.6); box-shadow: 0 0 14px rgba(255, 25, 255, 0.25); }


/* =========================================
   12. RESPONSIVE MOBILE (CAMPO ENORME E CENTRATO)
   ========================================= */
@media (max-width: 520px) {
    main { max-width: 100%; padding: 0 10px; }

    /* Il wrapper prende tutta la larghezza del parent ma è alto quanto il campo.
       Il campo si posiziona absolute dentro il wrapper, centrato sul viewport
       tramite left:50vw invece che 50% del parent (che aveva il padding di main). */
    .campo-container {
        padding: 15px 0;
        overflow: visible;
        position: relative;
        height: 680px;   /* era 740px — ridotto per avvicinare la panchina */
        width: 100%;
    }

    .campo-calcio {
        width: 540px;
        height: 710px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%) !important;
        margin: 0 !important;
    }

    /* RIMOZIONE TOTALE ANIMAZIONI STRANE: Caricamento istantaneo senza scatti fisici */
    .posizione,
    .posizione *,
    .panchina-slot,
    .panchina-slot *,
    .jersey-slot,
    .jersey-img,
    .jersey-info {
        transition: none !important;
        animation: none !important;
    }

    /* Cerchi vuoti piccolini iniziali */
    .posizione,
    .panchina-slot {
        width: 75px;
        height: 75px;
    }

    /* Dimensione dello slot mobile quando ospita la maglia */
    .posizione.selezionato,
    .panchina-slot.selezionato {
        width: 115px;
        height: 115px;
    }

    .jersey-img {
        width: 95px;
        height: 95px;
    }

    .jersey-info {
        margin-top: -18px;
        min-width: 82px;
        max-width: 110px;
    }

    /* ⚽ POSIZIONI TITOLARI MOBILE */
    .portiere    { bottom: 180px; left: 50%; transform: translateX(-50%) !important; }
    .difensore   { bottom: 320px; left: 50%; transform: translateX(-50%) !important; }
    .laterale-sx { bottom: 410px; left: 90px;  transform: none !important; }
    .laterale-dx { bottom: 410px; right: 90px; transform: none !important; }
    .pivot       { top: 110px;    left: 50%; transform: translateX(-50%) !important; }

    .panchina { gap: 12px; padding: 12px; }
}