/* css/auth.css */

/* ── Pulsante "☁ Accedi" / "👤 nome" — dentro l'header normale ── */
#btn-auth-header {
    /* nessun position:fixed — sta nell'header come gli altri pulsanti */
    transition: background-color 0.2s;
    white-space: nowrap;
}

#btn-auth-header.auth-logged-in {
    background-color: #27ae60 !important;
}

#btn-auth-header.auth-logged-in:hover {
    background-color: #1e8449 !important;
}

/* ── Modal backdrop ── */
#modal-auth,
#modal-account,
#modal-recovery,
#modal-conflict {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

/* ── Contenuto modal ── */
.auth-modal-content {
    background: #1e2a38;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    color: #ecf0f1;
}

.auth-modal-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: #ecf0f1;
    text-align: center;
}

/* ── Chiudi modal ── */
.auth-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
}

.auth-close-btn:hover {
    color: #ecf0f1;
}

/* ── Form fields ── */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.auth-field label {
    font-size: 0.8rem;
    color: #95a5a6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-field input {
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    border: 1px solid #34495e;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    border-color: #2980b9;
}

/* ── Pulsanti azione modal ── */
.auth-btn-primary {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 6px;
    background: #2980b9;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #1c6fa3;
}

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

.auth-btn-danger {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 6px;
    background: #c0392b;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
}

.auth-btn-danger:hover {
    background: #a93226;
}

/* ── Messaggi errore/successo ── */
#auth-error-msg,
#auth-error-msg-signup {
    font-size: 0.85rem;
    color: #e74c3c;
    min-height: 1.2em;
    margin-top: 0.5rem;
    text-align: center;
}

/* ── Spinner ── */
#auth-spinner,
#auth-spinner-signup {
    display: none;
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

/* ── Divisore "oppure" ── */
.auth-divider {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin: 1rem 0 0.5rem;
}

/* ── Switch login/signup ── */
.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: #7f8c8d;
    margin-top: 1rem;
}

.auth-switch button {
    background: none;
    border: none;
    color: #2980b9;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
    text-decoration: underline;
}

.auth-switch button:hover {
    color: #1c6fa3;
}

/* ── Modal account ── */
.account-email-display {
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

/* ── Badge cloud sync (placeholder step 4c) ── */
#badge-cloud-sync {
    display: none;
    font-size: 0.75rem;
    background: #27ae60;
    color: #fff;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Modal Recovery (step 5) ── */
.recovery-desc {
    text-align: center;
    color: #bdc3c7;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.recovery-desc strong {
    color: #ecf0f1;
    font-size: 1rem;
}

.recovery-timestamps {
    background: #2c3e50;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recovery-ts-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.recovery-ts-label {
    color: #7f8c8d;
    font-weight: 600;
}

.recovery-ts-value {
    color: #bdc3c7;
    font-variant-numeric: tabular-nums;
}

.recovery-ts-newer {
    color: #2ecc71;
    font-weight: 700;
}

.recovery-warning {
    text-align: center;
    color: #e67e22;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.recovery-btn-secondary {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: transparent;
    color: #95a5a6;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: color 0.2s, border-color 0.2s;
}

.recovery-btn-secondary:hover {
    color: #ecf0f1;
    border-color: #7f8c8d;
}

/* ── Modal Account — campo nome dispositivo (step 6) ── */
.auth-btn-secondary {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #2980b9;
    border-radius: 6px;
    background: transparent;
    color: #2980b9;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    transition: background-color 0.2s, color 0.2s;
}

.auth-btn-secondary:hover {
    background-color: #2980b9;
    color: #fff;
}

/* ── Recovery — riga dispositivo (step 6) ── */
.recovery-device-row {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-style: italic;
    padding-top: 0.25rem;
    border-top: 1px solid #34495e;
    margin-top: 0.25rem;
}
