/* css/welcome.css
 * ════════════════════════════════════════════════════════════════
 * WELCOME PAGE — Schermata iniziale per utenti non autenticati
 * ════════════════════════════════════════════════════════════════
 * Struttura:
 *   #welcome-page
 *     .wp-header          ← header a scacchiera verde/bianco con logo, testo, lingua, form
 *     .wp-illustration    ← illustrazione in basso
 * ════════════════════════════════════════════════════════════════
 */

/* ── Contenitore principale ─────────────────────────────────── */
/* body (in base.css) è già display:flex; flex-direction:column;
   min-height:100vh — #welcome-page si limita a "flex:1" per
   riempire lo spazio residuo condiviso con il footer, senza
   sommare un'altezza propria che causerebbe scroll in più. */
#welcome-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    font-family: inherit;
}

/* ── Header a scacchiera ────────────────────────────────────── */
.wp-header {
    position: relative;
    overflow: hidden;
    flex: 1;
    padding: 2.5rem 2rem 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;

    /* Scacchiera verde/bianco a copertura totale, diagonale */
    background-color: #ffffff;
    background-image: repeating-conic-gradient(
        #45a06a 0% 25%,
        #ffffff 0% 50%
    );
    background-size: 170px 170px;
}

/* Sfumatura bianca: stretta, aderente solo a logo/testo/lingua */
.wp-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse 32% 40% at 50% 30%,
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.97) 45%,
        rgba(255,255,255,0.75) 65%,
        rgba(255,255,255,0.25) 82%,
        rgba(255,255,255,0) 100%
    );
}

/* Tutti i figli diretti dell'header stanno sopra la sfumatura */
.wp-header > * {
    position: relative;
    z-index: 1;
}

/* ── Logo + titolo ──────────────────────────────────────────── */
.wp-logo-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.wp-logo-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(30, 77, 56, 0.25);
}

.wp-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wp-school-chess {
    color: #1a1a1a;
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-align: center;
}

.wp-tournament-manager {
    color: #1a1a1a;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
}

/* ── Testo descrittivo ──────────────────────────────────────── */
.wp-desc {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    max-width: 720px;
    line-height: 1.55;
    margin: 0;
}

.wp-desc-2 {
    margin-top: 0.5rem;
    font-style: italic;
    color: #1a1a1a;
}

/* ── Selettore lingua ───────────────────────────────────────── */
.wp-lang-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wp-lang-label {
    color: #1a1a1a;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wp-lang-btns {
    display: flex;
    gap: 6px;
}

.wp-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    background: #ffffff;
    border: 2px solid #1e4d38;
    color: #1e4d38;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wp-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    pointer-events: none;
}

.wp-lang-btn:hover {
    background: #eaf5ee;
}

.wp-lang-btn.wp-lang-active {
    background: #1e4d38;
    border-color: #1e4d38;
    color: #ffffff;
}

/* ── Form card con tab ──────────────────────────────────────── */
.wp-form-wrap {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
}

.wp-tabs {
    display: flex;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.wp-tab {
    flex: 1;
    padding: 10px 0;
    background: #1e4d38;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.wp-tab:hover:not(.wp-tab-active) {
    background: #2c6b4a;
}

.wp-tab.wp-tab-active {
    background: #ffffff;
    color: #1e4d38;
    font-weight: 600;
}

.wp-form-card {
    background: #ffffff;
    border-radius: 0 0 10px 10px;
    padding: 1.4rem 1.6rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.wp-form-panel {
    display: none;
}

.wp-form-panel.wp-panel-active {
    display: block;
}

/* ── Campi form ─────────────────────────────────────────────── */
.wp-field {
    margin-bottom: 0.75rem;
}

.wp-field label {
    display: block;
    font-size: 0.78rem;
    color: #555;
    margin-bottom: 3px;
    font-weight: 500;
}

.wp-field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: #222;
    background: #fafafa;
    transition: border-color 0.15s;
}

.wp-field input:focus {
    outline: none;
    border-color: #45a06a;
    background: #fff;
}

.wp-field-note {
    font-size: 0.72rem;
    color: #999;
    margin: 3px 0 0;
}

/* ── Link password dimenticata ──────────────────────────────── */
.wp-forgot {
    font-size: 0.76rem;
    color: #e07a9e;
    text-align: right;
    margin: -0.3rem 0 0.85rem;
    cursor: pointer;
    display: block;
}

.wp-forgot:hover {
    text-decoration: underline;
}

/* ── Pulsante principale ────────────────────────────────────── */
.wp-btn-primary {
    width: 100%;
    padding: 10px;
    background: #e07a9e;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.15rem;
}

.wp-btn-primary:hover {
    background: #d0608a;
}

.wp-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Messaggi errore / successo ─────────────────────────────── */
.wp-error-msg {
    font-size: 0.8rem;
    color: #e74c3c;
    min-height: 1.1em;
    margin: 0.5rem 0 0;
    text-align: center;
}

.wp-error-msg.wp-success {
    color: #27ae60;
}

/* ── Nota privacy ───────────────────────────────────────────── */
.wp-form-note {
    font-size: 0.73rem;
    color: #999;
    text-align: center;
    margin: 0.75rem 0 0;
    line-height: 1.5;
}

/* ── Pannelli recupero password / nuova password ────────────── */
.wp-recover-intro {
    font-size: 0.82rem;
    color: #555;
    text-align: center;
    line-height: 1.5;
    margin: 0 0 0.9rem;
}

.wp-back-link {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: #1a7a8a;
    cursor: pointer;
    margin-top: 0.9rem;
}

.wp-back-link:hover {
    text-decoration: underline;
}

.wp-privacy-link {
    color: #e07a9e;
    cursor: pointer;
    text-decoration: none;
}

.wp-privacy-link:hover {
    text-decoration: underline;
}

/* ── Spinner ────────────────────────────────────────────────── */
.wp-spinner {
    display: none;
    font-size: 0.8rem;
    color: #888;
    margin-left: 6px;
}

/* ── Illustrazione in basso ─────────────────────────────────── */
.wp-illustration {
    flex-shrink: 0;
    background-color: #f5f0e8;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 220px;
}

.wp-illustration img {
    height: 220px;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
    display: block;
}

/* ── Mobile: nascondi illustrazione ─────────────────────────── */
@media (max-width: 600px) {
    .wp-illustration {
        display: none;
    }

    .wp-header {
        padding: 2rem 1.2rem 1.8rem;
    }

    .wp-desc {
        font-size: 0.88rem;
        max-width: 100%;
    }

    .wp-lang-btns {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
}
