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

:root {
    --teal-dark: #194f4d;
    --teal-light: #00d4ff;
    --teal-medium: #1a6b68;
    --gold: #ffd700;
    --white: #ffffff;
    --dark-bg: #0a1a1a;
    --input-bg: rgba(255, 255, 255, 0.1);
    --glow-color: #00d4ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    color: var(--white);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Hexagonal Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px),
        repeating-linear-gradient(60deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px),
        repeating-linear-gradient(120deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== LOGIN PAGE STYLES ========== */
.branding-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.logo-box {
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
}

.logo-content {
    text-align: center;
}

.star-icon-img {
    width: 30px;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;
    filter: drop-shadow(0 0 10px var(--gold));
}

.star-icon-img-inline {
    width: 20px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 5px var(--gold));
}

.star-icon-role {
    width: 50px;
    height: auto;
    filter: drop-shadow(0 0 10px var(--gold));
}

.logo-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 1rem auto;
}

.logo-img-small {
    max-width: 200px;
    height: auto;
    display: block;
}

.logo-img-intro {
    max-width: 250px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

.logo-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--white);
    margin: 1rem 0;
    text-transform: lowercase;
    font-style: italic;
    letter-spacing: 2px;
}

.power-text {
    color: var(--teal-light);
}

.crown-icon {
    font-size: 2rem;
    display: inline-block;
    margin: 0 0.2rem;
    filter: drop-shadow(0 0 5px var(--gold));
}

.tagline {
    font-size: 1.2rem;
    color: var(--white);
    font-style: italic;
    margin-top: 0.5rem;
}

.wave-lines {
    margin-top: 2rem;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave-img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    filter: drop-shadow(0 0 10px var(--teal-light));
}

.wave {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--teal-light);
    border-radius: 50px;
    box-shadow: 0 0 10px var(--teal-light);
    animation: wave-animation 2s ease-in-out infinite;
}

.wave-1 {
    top: 10px;
    animation-delay: 0s;
}

.wave-2 {
    top: 30px;
    animation-delay: 0.5s;
}

@keyframes wave-animation {
    0%, 100% {
        transform: scaleX(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

.login-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 60%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.welcome-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--white);
    margin-bottom: 3rem;
    text-align: center;
}

.login-form {
    width: 100%;
    max-width: 450px;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--input-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    color: var(--white);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--teal-light);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.toggle-password:hover {
    opacity: 1;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--teal-light);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.remember-text {
    color: var(--white);
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-login {
    background: var(--teal-light);
    color: var(--white);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.btn-login:hover {
    background: #00b8e6;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    transform: translateY(-2px);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bottom-section {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    width: 100%;
    max-width: 500px;
    z-index: 100;
}

.btn-create-account {
    background: var(--teal-light);
    color: var(--white);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    width: auto;
    min-width: 200px;
}

.btn-create-account:hover {
    background: #00b8e6;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.support-text {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-size: 0.9rem;
}

.support-text a {
    color: var(--teal-light);
    text-decoration: none;
}

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

.chat-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(25, 79, 77, 0.9);
    border-top: 1px solid var(--teal-light);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.chat-assistant {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.chat-assistant:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-icon {
    font-size: 1.2rem;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 5px;
    color: var(--white);
    font-size: 0.9rem;
    outline: none;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-menu {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.alert-error {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ========== LANDING PAGE STYLES ========== */
.spiegazione-container {
    padding: 0;
}

/* Navigation Menu */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(25, 79, 77, 0.95);
    border-bottom: 2px solid var(--teal-light);
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo-img {
    max-height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover {
    color: var(--teal-light);
    background: rgba(0, 212, 255, 0.1);
}

.nav-link.active {
    color: var(--teal-light);
    border-bottom: 2px solid var(--teal-light);
}

.btn-nav-login {
    background: var(--teal-light);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
}

.btn-nav-login:hover {
    background: #00b8e6;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: all 0.3s ease;
}

.logout-link:hover .logout-icon {
    transform: translateX(3px);
}

/* Hero Section */
.hero-section {
    margin-top: 80px;
    padding: 4rem 2rem;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 1400px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-right .robot-img {
    max-width: 500px;
    width: 100%;
    height: auto;
}

/* Section Styles */
.protagonisti-section,
.come-funziona-section,
.registrati-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header .main-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header .subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.protagonisti-content {
    display: flex;
    justify-content: center;
}

.protagonisti-content .roles-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
}

.video-section {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.cta-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--teal-light);
    color: var(--white);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    background: #00b8e6;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid var(--teal-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* ========== SPIEGAZIONE PAGE STYLES (Legacy) ========== */
.spiegazione-container {
    padding: 0;
}

/* Legacy top-section - mantieni per compatibilità */
.top-section {
    display: none;
}

.logo-box-small {
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    padding: 1rem 2rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.logo-text-small {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    text-transform: lowercase;
    font-style: italic;
}

.main-title-box {
    flex: 1;
    text-align: center;
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.main-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    font-style: italic;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--white);
}

.video-box {
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    cursor: pointer;
    transition: transform 0.3s;
}

.video-box:hover {
    transform: scale(1.05);
}

.video-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-text {
    font-size: 0.9rem;
    color: var(--white);
}

/* Legacy main-content - mantieni per compatibilità */
.main-content {
    display: none;
}

.intro-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo-box-intro {
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.logo-text-intro {
    font-size: 2rem;
    font-weight: bold;
    color: var(--white);
    text-transform: lowercase;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.tagline-intro {
    font-size: 0.9rem;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.energia-img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

.brain-text {
    color: var(--white);
    font-size: 1.1rem;
    line-height: 1.8;
}

.brain-text p {
    margin-bottom: 0.5rem;
}

.brain-text-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.buttons-img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s;
}

.buttons-img:hover {
    transform: scale(1.05);
}

.btn-action {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: var(--teal-medium);
    color: var(--white);
    border: 2px solid var(--teal-light);
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    min-width: 180px;
}

.btn-bolletta {
    border-radius: 50px; /* Ovale */
}

.btn-carta-gold {
    border-radius: 50px; /* Ovale */
}

.btn-action:hover {
    background: var(--teal-light);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.btn-carta {
    flex: 1;
    padding: 1rem;
    background: var(--teal-medium);
    color: var(--white);
    border: 2px solid var(--teal-light);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-bolletta:hover,
.btn-carta:hover {
    background: var(--teal-light);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.robot-image {
    margin-top: 1rem;
}

.robot-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
}

.hierarchy-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hierarchy-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0 !important;
}

.hierarchy-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0 !important;
}

.hex-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: -0.75rem -0.5rem !important;
    background: rgba(25, 79, 77, 0.6);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    min-width: 120px;
    transition: transform 0.3s;
}

.hex-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.hex-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    border: 2px solid var(--teal-light);
}

.hex-icon.large {
    font-size: 3rem;
    width: 80px;
    height: 80px;
}

.main-leader {
    background: rgba(0, 212, 255, 0.3);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.hex-name {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: bold;
}

.roles-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.role-card {
    background: rgba(25, 79, 77, 0.8);
    border: 2px solid var(--teal-light);
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transition: transform 0.3s;
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.role-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    border: 3px solid var(--teal-light);
    margin: 0 auto 1.5rem;
}

.role-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

.role-icon.buddy {
    flex-direction: column;
    gap: 0.2rem;
}

.icon-crown,
.icon-heart {
    font-size: 2rem;
}

.role-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--white);
    margin-bottom: 1rem;
}

.role-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .protagonisti-content .roles-panel {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero-section {
        margin-top: 120px;
        padding: 2rem 1rem;
    }
    
    .protagonisti-section,
    .come-funziona-section,
    .registrati-section {
        padding: 2rem 1rem;
    }
    
    .section-header .main-title {
        font-size: 1.8rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .branding-panel,
    .login-panel {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .branding-panel {
        padding: 2rem 1rem;
    }
    
    .login-panel {
        padding: 2rem 1rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .top-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .main-title-box {
        text-align: left;
    }
}

