/*@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,700;1,500&family=Montserrat:wght@300;400;500&display=swap');
*/
:root {
    --viola-deep: #1b0f2e;
    --viola-mid: #2a1a45;
    --accent: #e8c15c;
    --accent-glow: rgba(232, 193, 92, 0.35);
    --viola-accent: #9b5de5;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(circle at 30% 20%, #2a1a45 0%, #1b0f2e 45%, #120a1f 100%);
    overflow-x: hidden;
    position: relative;
}

/* Bagliore di sfondo, fisso, puramente decorativo */
.bg-glow {
    position: fixed;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

input {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
}

#radioname1, #radioname2 {
    text-align: left;
}

/* ===== LOGIN BOX ===== */
.login-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 380px;
    transform: translate(-50%, -50%);
    padding: 45px 35px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-sizing: border-box;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 40px rgba(0,0,0,0.5), 0 0 25px var(--accent-glow);
    text-align: center;
    z-index: 1;
}

.login-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.login-box h2 {
    margin: 0 0 6px;
    padding: 0;
    color: #fff;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 30px;
}

.login-sub {
    margin: 0 0 30px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-box .user-box {
    position: relative;
    width: 100%;
    text-align: left;
}

.login-box .user-box input {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: #fff;
    margin-bottom: 32px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.35);
    outline: none;
    background: transparent;
    transition: border-color .3s;
}

.login-box .user-box input:focus {
    border-bottom-color: var(--accent);
}

.login-box .user-box input:disabled {
    color: rgba(255,255,255,0.6);
}

.login-box .user-box label {
    position: absolute;
    top: -20px;
    left: 0;
    padding: 10px 0;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--accent);
    pointer-events: none;
    transition: .5s;
}

/* ===== BOTTONE ACCEDI con bordo animato viola/oro ===== */
.login-box form {
    position: relative;
    display: block;
    padding: 12px 20px;
    color: var(--accent);
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    transition: .5s;
    margin-top: 15px;
    letter-spacing: 3px;
    border: 2px solid transparent;
    border-radius: 8px;
}

.login-box form span {
    position: absolute;
    display: block;
}

@keyframes btn-anim1 { 0% {left: -100%;} 50%, 100% {left: 100%;} }
@keyframes btn-anim2 { 0% {top: -100%;} 50%, 100% {top: 100%;} }
@keyframes btn-anim3 { 0% {right: -100%;} 50%, 100% {right: 100%;} }
@keyframes btn-anim4 { 0% {bottom: -100%;} 50%, 100% {bottom: 100%;} }

.login-box form span:nth-child(1) {
    top: 0; left: -100%; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent));
    animation: btn-anim1 1.4s linear infinite;
}
.login-box form span:nth-child(2) {
    top: -100%; right: 0; width: 2px; height: 100%;
    background: linear-gradient(180deg, transparent, var(--viola-accent));
    animation: btn-anim2 1.4s linear infinite;
    animation-delay: .35s;
}
.login-box form span:nth-child(3) {
    bottom: 0; right: -100%; width: 100%; height: 2px;
    background: linear-gradient(270deg, transparent, var(--accent));
    animation: btn-anim3 1.4s linear infinite;
    animation-delay: .7s;
}
.login-box form span:nth-child(4) {
    bottom: -100%; left: 0; width: 2px; height: 100%;
    background: linear-gradient(360deg, transparent, var(--viola-accent));
    animation: btn-anim4 1.4s linear infinite;
    animation-delay: 1.05s;
}

.submit {
    border: none;
    font-size: 20px;
    color: var(--accent);
    width: 100%;
    text-align: center;
    background-color: transparent;
    letter-spacing: 3px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0;
    border-radius: 6px;
    transition: .3s;
}

.submit:hover {
    background: var(--accent);
    color: var(--viola-deep);
}

/* ===== OVERLAY "Hai mangiato?" ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,5,20,0.85);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-box {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 35px 30px;
    border-radius: 16px;
    text-align: center;
    color: white;
    width: 260px;
    box-shadow: 0 0 30px var(--accent-glow);
}

.overlay-box h3 {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 24px;
    margin: 0 0 22px;
}

.overlay-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.overlay-btn {
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: #1b0f2e;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

.overlay-btn:hover {
    background: white;
    transform: translateY(-2px);
}

.overlay-btn-no {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
}

.overlay-btn-no:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== ANIMAZIONI VARIE ===== */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 var(--accent-glow); }
    50% { transform: scale(1.04); box-shadow: 0 0 18px var(--accent-glow); }
    100% { transform: scale(1); box-shadow: 0 0 0 var(--accent-glow); }
}

.pulse {
    animation: pulse 1.2s infinite;
}

/* ===== SCENA CUORE (invariata nella logica, solo ripulita) ===== */
#heart-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0517;
    overflow: hidden;
    z-index: 999999;
}

#heart-scene.hidden {
    display: none;
}

.heart-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    animation: glowGrow 2.5s ease forwards;
}

@keyframes glowGrow {
    0%   { width: 40px; height: 40px; opacity: 0; }
    35%  { opacity: 0.9; }
    100% { width: 1400px; height: 1400px; opacity: 1; }
}

.heart-half {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 300px;
    margin-top: -150px;
    overflow: hidden;
}

.heart-left {
    margin-left: -150px;
    animation: openLeft 2.5s ease forwards;
}

.heart-right {
    margin-left: 0;
    animation: openRight 2.5s ease forwards;
}

.heart-inner {
    position: absolute;
    top: 0;
    width: 300px;
    height: 300px;
    clip-path: path("M150,90 A60,60,0,0,1,270,90 Q270,180 150,270 Q30,180 30,90 A60,60,0,0,1,150,90 Z");
}

.heart-inner-left {
    left: 0;
    background: linear-gradient(135deg, #6a1b9a, #4a0f75);
    box-shadow: 0 0 40px rgba(106,27,154,0.6);
}

.heart-inner-right {
    left: -150px;
    background: linear-gradient(135deg, #f4d06f, #e8c15c);
    box-shadow: 0 0 40px rgba(232,193,92,0.6);
}

@keyframes openLeft {
    0%   { transform: translateX(0) scale(1); opacity: 1; }
    20%  { transform: translateX(0) scale(1.05); }
    100% { transform: translateX(-260px) scale(0.85); opacity: 0; }
}

@keyframes openRight {
    0%   { transform: translateX(0) scale(1); opacity: 1; }
    20%  { transform: translateX(0) scale(1.05); }
    100% { transform: translateX(260px) scale(0.85); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-box {
        padding: 35px 24px;
        max-width: 92%;
    }

    .login-box h2 {
        font-size: 24px;
    }

    .heart-half {
        width: 90px;
        height: 180px;
        margin-top: -90px;
    }

    .heart-left { margin-left: -90px; }

    .heart-inner {
        width: 180px;
        height: 180px;
        clip-path: path("M90,54 A36,36,0,0,1,162,54 Q162,108 90,162 Q18,108 18,54 A36,36,0,0,1,90,54 Z");
    }

    .heart-inner-right { left: -90px; }

    @keyframes openLeft {
        100% { transform: translateX(-160px) scale(0.85); opacity: 0; }
    }
    @keyframes openRight {
        100% { transform: translateX(160px) scale(0.85); opacity: 0; }
    }
}