/* Reset e stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjMGEwYTBhIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDVMNSAwWk02IC00TDQgNloiIHN0cm9rZT0iIzE1MTUxNSIgc3Ryb2tlLXdpZHRoPSIxIj48L3BhdGg+Cjwvc3ZnPg==') repeat;
    color: #ffffff;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(128, 0, 128, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

/* Background cuori animati */
.bg-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.heart {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(213, 128, 255, 0.3);
    transform: rotate(45deg);
    animation: hearts-fall linear infinite, hearts-shake ease-in-out infinite alternate;
}

.heart:before, .heart:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    border-radius: 50%;
}

.heart:before {
    top: -5px;
    left: 0;
}

.heart:after {
    top: 0;
    left: -5px;
}

@keyframes hearts-fall {
    0% { top: -10%; }
    100% { top: 100%; }
}

@keyframes hearts-shake {
    0%, 100% { transform: rotate(45deg) translateX(0); }
    50% { transform: rotate(45deg) translateX(80px); }
}

/* Header */
header {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(40, 0, 60, 0.8), rgba(10, 10, 10, 0.6));
    border-bottom: 1px solid #6a0dad;
    box-shadow: 0 0 20px rgba(106, 13, 173, 0.5);
}

header h1 {
    color: #d580ff;
    text-shadow: 0 0 15px rgba(213, 128, 255, 0.8);
    font-size: 1.5rem;
    margin: 0;
    animation: pulse 3s infinite;
    font-weight: 600;
    letter-spacing: 1px;
}

header span {
    color: #ff66cc;
}

@keyframes pulse {
    0% { text-shadow: 0 0 15px rgba(213, 128, 255, 0.8); }
    50% { text-shadow: 0 0 25px rgba(213, 128, 255, 1); }
    100% { text-shadow: 0 0 15px rgba(213, 128, 255, 0.8); }
}

/* Main content */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Form */
form {
    background-color: rgba(26, 13, 38, 0.8);
    padding: 20px;
    border: 1px solid #6a0dad;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(106, 13, 173, 0.3);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

form::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(106, 13, 173, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    transform: rotate(45deg);
    pointer-events: none;
    z-index: -1;
}

form h2 {
    color: #d580ff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.6rem;
    position: relative;
    padding-bottom: 15px;
}

form h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #6a0dad, #d580ff);
    border-radius: 3px;
}

/* Labels e inputs */
label {
    display: block;
    margin-top: 18px;
    margin-bottom: 8px;
    color: #d580ff;
    font-weight: 500;
    font-size: 1rem;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #6a0dad;
    border-radius: 8px;
    background-color: rgba(20, 10, 30, 0.8);
    color: #fff;
    transition: all 0.3s ease;
    font-size: 16px; /* Previene zoom su iOS */
}

input:focus {
    border-color: #d580ff;
    box-shadow: 0 0 10px rgba(213, 128, 255, 0.5);
    outline: none;
}

/* Checkbox remember me */
.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: #b8a8c6;
}

.remember-me input {
    accent-color: #6a0dad;
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* Button */
button {
    width: 100%;
    background: linear-gradient(to right, #6a0dad, #9b59b6);
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: linear-gradient(to right, #9b59b6, #6a0dad);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.3);
}

button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    100% { transform: scale(100, 100); opacity: 0; }
}

/* Messaggi di errore */
.error-message {
    color: #ffcccc;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: rgba(255, 0, 128, 0.2);
    border-radius: 6px;
    border-left: 3px solid #ff3399;
}

/* Links */
p {
    margin-top: 1.2rem;
    text-align: center;
    color: #aaa;
}

a {
    color: #d580ff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #d580ff;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

a:hover {
    color: #e5b3ff;
    text-shadow: 0 0 5px rgba(213, 128, 255, 0.5);
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.back-link {
    margin-top: 20px;
}

/* Responsive design - Tablet */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    form {
        padding: 25px;
    }
    
    form h2 {
        font-size: 1.8rem;
    }
    
    button {
        padding: 16px;
        font-size: 1.1rem;
    }
}

/* Responsive design - Desktop */
@media (min-width: 992px) {
    header h1 {
        font-size: 2.8rem;
    }
    
    main {
        padding: 2rem;
    }
    
    form {
        padding: 30px;
    }
}

/* Responsive design - Large screens */
@media (min-width: 1200px) {
    main {
        padding: 2rem;
    }
}

/* Accessibilità */
@media (prefers-reduced-motion) {
    .heart {
        animation: none;
    }
    
    button:hover {
        transform: none;
    }
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #8a2be2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9932cc;
}
