/* Import Google Font - Roboto Light */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
	-webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.header {
    position: absolute;
    top: 40px;
    right: 40px;
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 10;
}

.lang-btn {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 15px;
}

.lang-btn.active {
    color: #ff3046;
    font-weight: 400;
}

.lang-separator {
    color: #999;
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 300;
}

/* Logo centrato */
.logo-adele {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.logo-adele img {
    max-height: 80px;
    width: auto;
}

.logo-adele-text {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: #ff3046;
    letter-spacing: 2px;
}

.logo-adele-subtitle {
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    letter-spacing: 3px;
    margin-top: -5px;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.logo-container {
    margin-bottom: 80px;
}

.logo-red {
    width: 200px;
    height: 200px;
    background: #ff3046;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 20px 60px rgba(211, 47, 47, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo-red:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 70px rgba(211, 47, 47, 0.5);
}

.logo-red:active {
    transform: scale(0.95);
}

.logo-text {
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: white;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.main-text {
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 3px;
    text-align: center;
    color: #333;
    line-height: 1.4;
    max-width: 90%;
    animation: fadeIn 1s ease-in;
    text-transform: uppercase;
}

/* Header pagina annunci */
.annunci-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
}

/* Loader per iframe */
.iframe-loader {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.iframe-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #e0e0e0;
    border-top: 8px solid #ff3046;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.annunci-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.annunci-logo img {
    max-height: 80px;
    width: auto;
}

/* Bottone di ritorno - posizionato a destra */
.back-to-menu-btn {
    position: absolute;
    right: 40px;
    background: #ff3046;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: clamp(16px, 1.8vw, 24px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 48, 70, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}

.back-to-menu-btn:hover {
    background: #e02a3d;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 48, 70, 0.4);
}

.back-to-menu-btn:active {
    transform: translateY(-1px);
}

.back-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Iframe annunci con stile per nascondere banner cookie */
#annunciFrame {
    margin-top: 120px !important;
    height: calc(100vh - 120px) !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(211, 47, 47, 0.3);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Pagine */
.page {
    display: none;
    height: 100vh;
    width: 100vw;
    flex-direction: column;
}

.page.active {
    display: flex;
}

/* Pagina di smistamento */
.smistamento-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 60px;
    gap: 60px;
}

.smistamento-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 3px;
    text-align: center;
    color: #333;
    margin-bottom: 40px;
    text-transform: uppercase;
    line-height: 1.2;
}

.options-container {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
    flex-wrap: wrap;
}

.option-card {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    height: 610px;
    background: #ff3046;
    border-radius: 20px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(255, 48, 70, 0.3);
    position: relative;
}

.option-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(255, 48, 70, 0.4);
}

.option-card:active {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(255, 48, 70, 0.5);
}

/* Icone PNG */
.option-icon {
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.icon-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.icon-comprare {
    background-image: url('icons/deal.png');
}

.icon-vendere {
    background-image: url('icons/key.png');
}

.option-text {
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #ffffff;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    line-height: 1.3;
}

.continue-btn {
    background: #ff3046;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 30px 80px;
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 48, 70, 0.3);
    margin-top: 40px;
    text-transform: uppercase;
}

.continue-btn:hover {
    background: #e02a3d;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 48, 70, 0.4);
}

.continue-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Pagina QR Code - DIMENSIONI CORRETTE */
.qr-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px;
    gap: 60px;
}

.qr-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 3px;
    text-align: center;
    color: #333;
    text-transform: uppercase;
    line-height: 1.2;
}

.qr-code {
    width: 400px;
    height: 400px;
    background: white;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* FIX: QR Code contenuto correttamente */
.qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-placeholder img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.qr-instruction {
    font-size: clamp(18px, 2.5vw, 32px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    text-align: center;
    max-width: 800px;
    line-height: 1.4;
}

/* Form */
.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 80px;
    overflow-y: auto;
}

.form-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 3px;
    color: #333;
    margin-bottom: 50px;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.2;
}

.form-group {
    margin-bottom: 35px;
}

.form-label {
    font-size: clamp(16px, 2vw, 24px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #333;
    margin-bottom: 12px;
    display: block;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 20px 25px;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #ff3046;
    box-shadow: 0 0 0 3px rgba(255, 48, 70, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 40px 0;
}

.checkbox {
    width: 32px;
    height: 32px;
    cursor: pointer;
    accent-color: #ff3046;
}

.privacy-text {
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    line-height: 1.6;
}

.submit-btn {
    background: #ff3046;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 28px 0;
    font-size: clamp(22px, 2.5vw, 36px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 48, 70, 0.3);
    width: 100%;
    margin-top: 30px;
    text-transform: uppercase;
}

.submit-btn:hover:not(:disabled) {
    background: #e02a3d;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 48, 70, 0.4);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Pagina successo */
.success-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
    padding: 80px;
}

.success-icon {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #4caf50;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: scaleIn 0.5s ease-out;
}

.checkmark {
    width: 90px;
    height: 90px;
    stroke: white;
    stroke-width: 8;
    stroke-linecap: round;
    fill: none;
    animation: drawCheck 0.5s 0.3s ease-out forwards;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #333;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.2;
}

.success-text {
    font-size: clamp(18px, 2.5vw, 32px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    color: #666;
    text-align: center;
    max-width: 900px;
    line-height: 1.5;
}

.back-btn {
    background: #ff3046;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 25px 70px;
    font-size: clamp(20px, 2.5vw, 32px);
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.back-btn:hover {
    background: #e02a3d;
    transform: translateY(-3px);
}

/* Responsive per schermi medi */
@media (max-width: 1024px) {
    .options-container {
        flex-direction: column;
        align-items: center;
    }
    
    .option-card {
        max-width: 80%;
    }
}

/* Responsive per dispositivi mobili */
@media (max-width: 768px) {
    .logo-adele {
        top: 20px;
    }
    
    .smistamento-container {
        padding: 40px 20px;
    }
    
    .smistamento-title,
    .qr-title,
    .form-title,
    .success-title {
        font-size: clamp(24px, 6vw, 40px);
    }
    
    .option-card {
        min-width: 250px;
        height: 500px;
        padding: 40px 30px;
    }
    
    .option-icon {
        width: 120px;
        height: 120px;
    }
    
    .option-text {
        font-size: clamp(22px, 5vw, 36px);
    }
    
    /* FIX Mobile: QR Code ridimensionato */
    .qr-code {
        width: 300px;
        height: 300px;
    }
    
    .annunci-header {
        height: 100px;
        padding: 0 20px;
    }
    
    .annunci-logo {
        position: static;
        transform: none;
        margin: 0 auto;
    }
    
    .annunci-logo img {
        max-height: 60px;
    }
    
    .back-to-menu-btn {
        padding: 12px 24px;
        font-size: 14px;
        position: absolute;
        right: 20px;
    }
    
    .back-to-menu-btn span {
        display: none;
    }
    
    .back-icon {
        width: 20px;
        height: 20px;
    }
    
   #annunciFrame {
        margin-top: 100px !important;
        height: calc(100vh - 100px) !important;
    }
    
    .iframe-loader {
        top: 100px;
    }
    
    .loader-spinner {
        width: 60px;
        height: 60px;
        border-width: 6px;
    }
    
    .loader-text {
        font-size: 16px;
    }
}
}

/* Media queries per schermi grandi (32 pollici) */
@media (min-height: 1920px) {
    .logo-red {
        width: 280px;
        height: 280px;
    }
    
    .logo-text {
        font-size: 58px;
    }
    
    .main-text {
        font-size: 96px;
    }
    
    .lang-btn {
        font-size: 48px;
    }
    
    .lang-separator {
        font-size: 48px;
    }

    .logo-adele img {
        max-height: 120px;
    }

    .option-card {
        height: 700px;
    }

    .option-icon {
        width: 180px;
        height: 180px;
        margin-bottom: 30px;
    }
    
    .option-text {
        font-size: 64px;
    }

    .qr-code {
        width: 550px;
        height: 550px;
    }
    
    .annunci-header {
        height: 140px;
    }
    
    .annunci-logo img {
        max-height: 100px;
    }
    
    .back-to-menu-btn {
        padding: 20px 40px;
        font-size: 28px;
    }
    
    .back-icon {
        width: 28px;
        height: 28px;
    }
    
    #annunciFrame {
        margin-top: 140px !important;
        height: calc(100vh - 140px) !important;
    }
    
    .smistamento-title,
    .qr-title,
    .form-title,
    .success-title {
        font-size: 80px;
    }
}