/* Global Styles & Resets */
:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #FFC107; /* Amber */
    --text-color: #333;
    --background-color: #f4f7f6;
    --border-color: #ddd;
    --card-background: #fff;
    --shadow-color: rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: var(--card-background);
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    box-shadow: 0 2px 4px var(--shadow-color);
    gap: 1rem;
}

.header__logo {
    height: 60px;
    width: auto;
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    flex-grow: 1;
}

/* Event Info */
.event-info {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.event-info__title {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.event-info__details {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.event-info__location,
.event-info__time {
    display: block;
    margin-bottom: 0.3rem;
}

.event-info__price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 1rem;
}

.event-info__speakers {
    margin-top: 1.5rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    background-color: #f0f8f0; /* Light green background */
    border-left: 5px solid var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.event-info__speakers h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.event-info__speakers ul {
    list-style: none; /* Remove default bullet points */
    padding: 0;
}

.event-info__speakers li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #555;
}

.event-info__speakers li strong {
    color: var(--text-color);
}

/* Form Styles */
.ticket-form {
    padding: 1.5rem 0;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.attendee-details {
    margin-top: 2rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1.5rem;
}

.attendee-block {
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
}

.attendee-block h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.payer-details {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    background-color: #f9f9f9;
}

.payer-details legend {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* New: Styles for phone input group */
.phone-group .phone-inputs {
    display: flex;
    gap: 10px;
}

.phone-group .phone-inputs input {
    flex: 1;
}

.phone-group .phone-inputs input[name="payerPhoneAreaCode"] {
    flex: 0 0 80px; /* Fixed width for area code */
}

/* Payment Info */
.payment-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

.payment-info h3 {
    margin-bottom: 1rem;
    color: #555;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #e8f5e9; /* Light green for payment info */
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
}

.mercadopago-logo {
    height: 40px;
    width: auto;
}

.payment-option span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Buttons */
.buy-button { 
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 2rem;
}

.buy-button:hover {
    background-color: #43A047; /* Darker green */
    transform: translateY(-2px);
}

.buy-button:active {
    transform: translateY(0);
}

/* New: Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    font-size: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.loading-spinner {
    border: 8px solid rgba(76, 175, 80, 0.2); /* Light green */
    border-top: 8px solid var(--primary-color); /* Darker green */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Footer */
.footer {
    background-color: var(--card-background);
    color: var(--text-color);
    padding: 1.5rem 1rem;
    text-align: center;
    margin-top: 2rem;
    box-shadow: 0 -2px 4px var(--shadow-color);
}

.footer__social {
    margin-bottom: 1rem;
}

.social-link {
    color: #555;
    text-decoration: none;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--primary-color);
}

.social-icon {
    height: 24px;
    width: 24px;
    vertical-align: middle;
}

.footer__terms .terms-link {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer__terms .terms-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}


/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .header__title {
        font-size: 1.5rem;
    }

    .container {
        margin: 1rem auto;
        padding: 1rem;
    }

    .event-info__title {
        font-size: 1.8rem;
    }

    .event-info__details {
        font-size: 1rem;
    }

    .event-info__price {
        font-size: 1.3rem;
    }

    .event-info__speakers {
        margin-top: 1rem;
        padding: 0.8rem;
    }

    .event-info__speakers h3 {
        font-size: 1.1rem;
    }

    .event-info__speakers li {
        font-size: 0.95rem;
    }

    .form-group input,
    .buy-button { 
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }

    .mercadopago-logo {
        height: 30px;
    }

    .payment-option span {
        font-size: 0.9rem;
    }

    .footer {
        padding: 1rem 0.5rem;
    }

    .social-link {
        margin: 0 5px;
        font-size: 0.9rem;
    }

    .social-icon {
        height: 20px;
        width: 20px;
    }

    .footer__terms .terms-link {
        font-size: 0.8rem;
    }

    .phone-group .phone-inputs {
        flex-direction: column;
        gap: 5px;
    }

    .phone-group .phone-inputs input[name="payerPhoneAreaCode"] {
        flex: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: row; 
        gap: 0; 
        padding: 1rem 0.5rem;
    }

    .header__logo {
        height: 50px;
    }

    .container {
        margin: 0.5rem auto;
        padding: 0.8rem;
        border-radius: 0; 
        box-shadow: none;
    }

    .event-info__title {
        font-size: 1.5rem;
    }

    .attendee-block, .payer-details {
        padding: 0.8rem;
    }

    .payer-details legend {
        font-size: 1.1rem;
    }

    .payment-option {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .social-link {
        display: block;
        margin: 0.5rem 0;
    }
}