/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(13, 13, 31, 0.85);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.08), 0 24px 48px rgba(0,0,0,.4);
    animation: fadeUp .6s ease both;
}

/* ── LOGO ─────────────────────────────────────────────────────────────────── */
.auth-logo {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 1.75rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}
.auth-logo:hover { opacity: .8; }

/* ── TITOLO ───────────────────────────────────────────────────────────────── */
.auth-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: .4rem;
    letter-spacing: .5px;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ── FORM ─────────────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

.form-group label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .3px;
}

.form-group input {
    width: 100%;
    padding: .7rem 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .92rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder { color: rgba(148,163,184,.4); }
.form-group input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 3px rgba(168,85,247,.12);
}
.form-group input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.form-group input.valid {
    border-color: var(--neon-green);
}

/* Input con occhio */
.input-eye {
    position: relative;
}
.input-eye input {
    padding-right: 2.8rem;
}
.eye-btn {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.eye-btn:hover { color: var(--neon-purple); }

.field-hint {
    font-size: .75rem;
    color: rgba(148,163,184,.6);
    line-height: 1.4;
}
.field-error {
    font-size: .78rem;
    color: #ef4444;
    min-height: 1rem;
    line-height: 1.4;
}

/* Errore globale form */
.form-error {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: var(--radius);
    color: #ef4444;
    font-size: .85rem;
    padding: .65rem 1rem;
    margin-bottom: 1rem;
    display: none;
    line-height: 1.5;
}
.form-error.show { display: block; }

/* Submit */
.btn-form {
    width: 100%;
    justify-content: center;
    padding: .85rem;
    font-size: .95rem;
    margin-top: .5rem;
    position: relative;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

/* ── SWITCH LINK ──────────────────────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .88rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--neon-purple);
    font-weight: 600;
    transition: var(--transition);
}
.auth-switch a:hover { color: var(--neon-blue); }

/* ── ANIMAZIONI ───────────────────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.25rem; }
}
