:root {
    /* Define defaults, will be overwritten by JS based on config.js */
    --primary-color: #213D72;
    --secondary-color: #1D1D1B;
    --light-color: #FFFFFF;

    /* Elegant glassmorphism properties - brighter blue tint */
    --glass-bg: rgba(33, 61, 114, 0.9);
    /* Vibrant translucent blue background */
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 16px 40px 0 rgba(33, 61, 114, 0.35);
}

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

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--light-color);
    overflow-x: hidden;
    background-color: transparent;
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    transform: scale(1.05);
    /* Avoid edges due to any blur or subtle pan animations */
    animation: drift 30s ease-in-out infinite alternate;
}

@keyframes drift {
    0% {
        transform: scale(1.05) translate(0, 0);
    }

    100% {
        transform: scale(1.08) translate(-10px, 10px);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Lighter gradient without any dark gray/black, keeping it fresh and bright */
    /* background: linear-gradient(135deg, rgba(33, 61, 114, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%);*/
    background: linear-gradient(180deg, rgba(189, 212, 254, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%);
    z-index: -1;
    /* Rimosso il backdrop-filter blur per rendere visibile l'immagine di sfondo */
}

/* Language Selector */
.lang-selector {
    position: absolute;
    top: 2.5rem;
    right: 3.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(33, 61, 114, 0.9);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    padding: 0.3rem 0.5rem;
}

.lang-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.lang-btn.active {
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.3);
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

.card {
    flex: 1 1 100%;
    max-width: 650px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    /* Strong glass blur ONLY on the card */
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    will-change: transform, box-shadow;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo {
    max-width: 240px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: opacity 0.3s ease;
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: center;
}

.title {
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--light-color);
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.greeting {
    font-size: 1.2rem;
    font-weight: 600;
}

.message {
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 300;
    opacity: 0.95;
    margin: 0 auto;
    max-width: 500px;
}

.message a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.message a:hover {
    text-decoration: underline;
}

.message a[target="_blank"]::after {
    content: "";
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.25em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14L21 3'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14L21 3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.thanks {
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 1.5rem;
    color: #e0ecff;
    /* Very light subtle blue tint */
}

.card-footer {
    margin-top: 3.5rem;
    text-align: center;
}

.lang-label {
    display: inline-block;
    padding: 0.5rem 1.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Fade Animation for smooth language switch */
.content-fade {
    animation: contentFade 0.4s ease forwards;
}

@keyframes contentFade {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        position: fixed;
        top: 4.75rem;
        right: 0;
        bottom: 0;
        left: 0;
        min-height: 0;
        padding: 0.5rem 1.5rem 1.5rem 1.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: flex-start;
    }

    .card {
        margin: auto;
        padding: 2.5rem 1.5rem;
    }

    .lang-selector {
        position: fixed;
    }

    .title {
        font-size: 2rem;
    }

    .logo {
        max-width: 220px;
    }

    .lang-selector {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }
}