* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7B6BA8;
    --primary-light: #9B8EC4;
    --primary-dark: #6A5A97;
    --primary-deeper: #4A4168;
    --accent: #7072EB;
    --accent-light: #8A81D7;
    --app-lavender: #E8E3F5;
    --bg-lavender: #F7F7FF;
    --bg-lavender-mid: #F2F0FF;
    --bg-lavender-deep: #ECE7FF;
    --text-dark: #4A4168;
    --text-body: #5D5478;
    --text-muted: #8B7FB5;
    --white: #FFFFFF;
    --cream: #FAFAFF;
    --error: #E53935;
    --error-bg: #FFEBEE;
    --shadow: 0 20px 60px rgba(123, 107, 168, 0.16);
    --shadow-hover: 0 25px 70px rgba(123, 107, 168, 0.25);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, var(--bg-lavender) 0%, var(--bg-lavender-mid) 50%, var(--cream) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(112, 114, 235, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(219, 222, 250, 0.35) 0%, transparent 60%);
    border-radius: 50%;
}

.lang-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-selector select {
    padding: 10px 16px;
    border: 2px solid rgba(123, 107, 168, 0.15);
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--white);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(123, 107, 168, 0.08);
}

.lang-selector select:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(123, 107, 168, 0.15);
}

.login-container {
    background: var(--white);
    padding: 50px 45px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
    border: 1px solid rgba(123, 107, 168, 0.06);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(123, 107, 168, 0.3);
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.logo h1 {
    font-family: 'Playfair Display', 'DM Sans', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--bg-lavender-deep);
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-dark);
    transition: all 0.3s ease;
    background: var(--bg-lavender);
}

input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(112, 114, 235, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

button[type="submit"] {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #6A5A97, #5B5DE6);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(91, 93, 230, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    letter-spacing: 0.01em;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(91, 93, 230, 0.55);
    background: linear-gradient(135deg, #5E4F8A, #4E50D9);
}

button[type="submit"]:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 3px 12px rgba(91, 93, 230, 0.5);
    transition: all 0.1s ease;
}

.error {
    background: var(--error-bg);
    color: var(--error);
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 22px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid var(--error);
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.links {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
}

.links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.links a:hover {
    color: var(--accent);
}

.links p {
    color: var(--text-muted);
    margin-top: 16px;
}

/* Logo immagine */
.logo-img {
    display: block;
    margin: 0 auto 18px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 480px) {
    .login-container {
        padding: 35px 28px;
        border-radius: 20px;
    }

    .logo h1 {
        font-size: 28px;
    }
}

/* Modal reset password */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(74, 65, 104, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.2rem;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow);
    animation: slideUp 0.4s ease-out;
}
.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.modal-close:hover { color: var(--primary); }
.modal-card h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}
.modal-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.modal-card input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(123, 107, 168, 0.15);
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    outline: none;
    margin-bottom: 1rem;
    transition: all 0.3s;
    background: var(--cream);
}
.modal-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(123, 107, 168, 0.1);
    background: var(--white);
}
.modal-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #6A5A97, #5B5DE6);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(91, 93, 230, 0.4);
    transition: all 0.3s;
}
.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(91, 93, 230, 0.55);
}
