/* ===== LOGIN - DASHBOARD CONSISTENT THEME ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIABILI ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card-start: #0f172a;
    --bg-card-end: #0a2540;

    --accent: #ff9100;
    --accent-hover: #ff6b00;

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --border: rgba(255, 145, 0, 0.2);
    --radius: 12px;
    --transition: 0.3s ease;

    --gradient: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

/* ===== BODY ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-primary);
}

/* ===== CONTAINER ===== */
.login-container {
    max-width: 400px;
    width: 100%;
    background: linear-gradient(135deg, var(--bg-card-start), var(--bg-card-end));
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: fadeInUp 0.4s ease;
}

/* ===== ANIMAZIONE ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER ===== */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== MODULE BADGE ===== */
.module-badge {
    display: block;
    background: rgba(255, 145, 0, 0.15);
    color: var(--accent);
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 1.3rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== INPUT ===== */
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

input::placeholder {
    color: var(--text-tertiary);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,145,0,0.2);
}

input:hover {
    border-color: var(--accent-hover);
}

/* ===== BUTTON LOGIN ===== */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1rem;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,145,0,0.25);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

/* ===== LINK ===== */
.register-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.register-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    color: var(--accent-hover);
}

/* ===== LOGIN VERSIONE FREE ===== */
.free-login-link {
    margin-top: 0.8rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.free-login-link a {
    color: var(--accent);
    text-decoration: none;
}

.free-login-link a:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
.footer-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    margin: 0 0.4rem;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ===== ALERT ===== */
.error-message {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    padding: 0.7rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid rgba(239,68,68,0.3);
}

.success-message {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    padding: 0.7rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid rgba(34,197,94,0.3);
}

/* ===== SPINNER ===== */
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }

    .login-header h1 {
        font-size: 1.8rem;
    }
}

/* ===== CARD LOGIN VERSIONE FREE (MIGLIORATA) ===== */
.free-login-card {
    display: block;
    margin-top: 1rem;
    padding: 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;

    /* 👉 sfondo più neutro e leggibile */
    background: rgba(255, 255, 255, 0.04);

    border: 1px solid var(--border);
    transition: var(--transition);

    /* 👉 testo centrato */
    text-align: center;
}

.free-login-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(255, 145, 0, 0.08);
    box-shadow: 0 8px 20px rgba(255,145,0,0.15);
}

/* Titolo */
.free-login-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

/* Sottotitolo */
.free-login-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
