* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Stelle sullo sfondo */
.stelle {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stella {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: brillio 2s infinite alternate;
}

@keyframes brillio {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Stella cadente ogni tanto */
.stella-cadente {
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
    animation: caduta 1s linear infinite;
    opacity: 0;
}

@keyframes caduta {
    0% {
        opacity: 0;
        transform: translateY(-100px) translateX(0) rotate(-45deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(-200px) rotate(-45deg);
    }
}

.container {
    background: linear-gradient(160deg, 
        rgba(30, 27, 75, 0.7) 0%, 
        rgba(49, 46, 129, 0.5) 30%, 
        rgba(67, 56, 202, 0.4) 60%, 
        rgba(30, 27, 75, 0.7) 100%);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 45px 35px;
    box-shadow: 
        0 0 60px rgba(124, 58, 237, 0.3),
        0 0 120px rgba(67, 56, 202, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(167, 139, 250, 0.25);
    max-width: 430px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fluttua 4s ease-in-out infinite;
}

@keyframes fluttua {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.luna {
    font-size: 55px;
    margin-bottom: 10px;
    animation: giraLuna 8s linear infinite;
    display: inline-block;
}

@keyframes giraLuna {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1); }
    75% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}

h2 {
    color: #e0d9ff;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 2px;
    font-size: 24px;
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.6);
}

.subtitle {
    color: #a5a0c9;
    font-size: 13px;
    margin-bottom: 30px;
    font-style: italic;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    color: #c4b5fd;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(30, 27, 75, 0.5);
    border: 1.5px solid rgba(167, 139, 250, 0.3);
    border-radius: 16px;
    color: #e8e4ff;
    font-size: 15px;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    outline: none;
    font-family: inherit;
}

.input-group input::placeholder {
    color: rgba(180, 170, 220, 0.4);
    font-size: 13px;
}

.input-group input:focus {
    border-color: #a78bfa;
    box-shadow: 
        0 0 25px rgba(167, 139, 250, 0.4),
        inset 0 0 15px rgba(167, 139, 250, 0.08);
    background: rgba(49, 46, 129, 0.5);
}

.input-group input.error {
    border-color: #f87171;
    box-shadow: 
        0 0 25px rgba(248, 113, 113, 0.5),
        inset 0 0 15px rgba(248, 113, 113, 0.1);
    animation: trema 0.6s ease;
    color: #fca5a5;
}

@keyframes trema {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px) rotate(-1deg); }
    30% { transform: translateX(6px) rotate(1deg); }
    45% { transform: translateX(-4px) rotate(-0.5deg); }
    60% { transform: translateX(4px) rotate(0.5deg); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #7c3aed, #6366f1, #4f46e5);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-top: 10px;
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.35);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6, #818cf8, #6366f1);
}

.btn:hover::before {
    opacity: 1;
    animation: brilloBtn 1.5s ease infinite;
}

@keyframes brilloBtn {
    0% { left: -50%; }
    100% { left: 150%; }
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn span {
    display: inline-block;
    animation: razzo 0.6s ease-in-out infinite alternate;
}

.btn span:first-child {
    animation-delay: 0s;
}

.btn span:last-child {
    animation-delay: 0.3s;
}

@keyframes razzo {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.error-message {
    color: #fca5a5;
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: 10px;
    min-height: 22px;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(252, 165, 165, 0.3);
}

.hint {
    color: #6b6496;
    font-size: 11px;
    margin-top: 18px;
    letter-spacing: 1px;
}