/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background-color: #ffcd00; /* Poste Italiane Yellow */
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    font-size: 14px;
    font-weight: 500;
}

.header-left a, .header-right a {
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px; /* Increased height for better quality */
    width: auto;
    object-fit: contain; /* Ensure it fits nicely without distortion */
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 60px auto;
    text-align: center;
    padding: 0 20px;
    flex: 1; /* Push footer down */
}

/* Search Section */
h1 {
    font-size: 42px;
    color: #333;
    margin-bottom: 40px;
    font-weight: 700;
}

.search-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto 20px;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 25px;
    border: 1px solid #ccc;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #0047bb;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 44px;
    width: 44px;
    background-color: #0047bb;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

.search-btn:hover {
    background-color: #003399;
}

.helper-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Accordion / Info Section */
.info-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.info-header h3 {
    font-size: 18px;
    margin: 0;
    color: #333;
}

.accordion-item {
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-item span {
    color: #0047bb;
    font-size: 20px;
}

/* PostePlus Card */
.promo-card {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: left;
    min-height: 300px;
}

.card-image {
    width: 40%;
    background-color: #cceeff; /* Light blue background for illustration */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0; /* Remove default padding/centering flex if image covers it */
}

/* Placeholder for the illustration */
.illustration-placeholder {
    width: 80%;
    height: 80%;
    background: url('../img/poste-illustration.png') no-repeat center center;
    background-size: contain;
}

/* Remove fallback */
.card-image::after {
    display: none; 
}

.card-content {
    width: 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.card-content p {
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
}

.btn-primary {
    background-color: #0047bb;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    width: fit-content;
}

.btn-primary:hover {
    background-color: #003399;
}

/* Footer */
footer {
    background-color: #f3f8fc; /* Light blueish background */
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #e6e6e6;
    margin-top: auto;
}

/* Universal Loader Styles */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 60px; /* Adjust size to fit inside circle */
    height: auto;
    position: relative;
    z-index: 2;
}

.spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #ffcd00; /* Yellow spinner */
    border-right: 4px solid #ffcd00;
    border-radius: 50%;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}


/* Responsive Media Queries */
@media (max-width: 768px) {
    /* Header Responsive */
    header {
        padding: 0 15px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
        justify-content: center;
    }

    .header-left, .header-right {
        display: none;
    }
    
    .desktop-text {
        display: none;
    }
    
    .header-right {
        gap: 15px;
    }

    .logo {
        margin: 0 auto;
    }

    /* Main Container */
    .container {
        margin: 30px auto;
        padding: 0 15px;
    }

    /* Search Section */
    h1 {
        font-size: 28px;
        margin-bottom: 25px;
    }

    .search-input {
        font-size: 14px;
        padding: 12px 45px 12px 20px;
    }

    .search-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    /* Promo Card */
    .promo-card {
        flex-direction: column;
        min-height: auto;
    }

    .card-image {
        width: 100%;
        height: 180px;
    }

    .card-content {
        width: 100%;
        padding: 25px 20px;
    }

    .card-content h2 {
        font-size: 20px;
    }

    .card-content p {
        font-size: 14px;
    }

    /* Form Rows (Stack vertically on mobile) */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin-bottom: 15px;
    }

    /* Steps Indicator */
    .step-indicator {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        margin-top: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .btn-pay, .btn-confirm, .btn-primary {
        width: 100%;
        padding: 15px 20px;
    }
}
