@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

:root {
    --primary-color: #002C5B; /* User's custom blue */
    --text-color: #1d1d1f; /* Near-black for text */
    --text-color-secondary: #6e6e73;
    --background-color: #f5f5f7;
    --card-background-color: #ffffff;
    --border-color: #d2d2d7;
    --error-color: #be0915; /* User's custom red */
    --font-family: 'Lato', sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    /* Subtle dot pattern */
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 0);
    background-size: 25px 25px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 3rem 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    animation: fadeIn 0.5s ease-out forwards;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-background-color);
    color: var(--text-color-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.lang-btn.active, .lang-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.5s ease-out 0.1s forwards;
    opacity: 0;
}

.logo-image {
    max-width: 200px; /* Adjust as needed */
    margin-bottom: 1rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.header h1 {
    font-size: 1.25rem;
    color: var(--text-color-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    text-transform: capitalize;
}

.header-occasion {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    margin-top: 1rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

.content-wrapper {
    background-color: var(--card-background-color);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    padding: 2.5rem 3rem;
    animation: fadeIn 0.5s ease-out 0.2s forwards;
    opacity: 0;
    box-shadow: var(--card-shadow);
}

.events-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.event-details-group {
    margin-bottom: 0;
}
.event-details-group:last-child {
    margin-bottom: 0;
}

.event-description {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-transform: capitalize;
}

.event-meta {
    color: var(--text-color-secondary);
    font-size: 1rem;
    line-height: 1.4;
}

.event-separator {
    font-style: italic;
    color: var(--text-color-secondary);
    margin: 0.5rem 0;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    position: relative; /* For icon positioning */
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-secondary);
    transition: color 0.2s ease-in-out;
    width: 20px;
    height: 20px;
}

.required {
    color: var(--primary-color);
    margin-left: 2px;
}

input[type="text"], input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 40px; /* Left padding for icon */
    border: none;
    border-bottom: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s ease-in-out;
    background-color: transparent;
}

input[type="text"]:focus, 
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: none;
    background-color: transparent;
}

input[type="text"]:focus ~ .form-icon,
input[type="email"]:focus ~ .form-icon {
    color: var(--primary-color);
}


/* --- Validation Styles --- */
input.invalid {
    border-color: var(--error-color);
    box-shadow: none;
}
input.invalid:focus {
    box-shadow: none;
}

.error-feedback {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}


.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    border-color: var(--border-color);
}

.checkbox-item label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Checkbox Indicator */
.checkbox-indicator {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-indicator {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-indicator::after {
    content: '';
    position: absolute;
    left: 5.2px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.submit-btn:hover {
    filter: brightness(1.1);
}

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

/* --- Captcha Styling --- */
.cf-turnstile-container {
    grid-column: 1 / -1; /* Make it full width in the grid */
    /* background-color: var(--background-color); */
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* --- Alert Messages --- */
.alert-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
    animation: fadeIn 0.3s ease-out;
    grid-column: 1 / -1; /* Make it full width in the grid */
}

.success-message {
    background-color: #e6f9f0;
    color: #00854d;
    border-color: #a6e9c9;
}

.error-message {
    background-color: #fbeae9;
    color: var(--error-color);
    border-color: #f7c9c5;
}

.privacy-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

.privacy-links a {
    color: #c41e3a;
    text-decoration: none;
}

.privacy-links a:hover {
    text-decoration: underline;
}


.form-footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 768px) {
    body {
        padding: 1.5rem 1rem;
    }
    .header {
        margin-bottom: 2rem;
    }
    .logo-image {
        max-width: 160px;
    }
    .header h1 {
        font-size: 1.1rem;
    }
    .header-occasion {
        font-size: 1rem;
    }
    .content-wrapper {
        padding: 2rem 1.5rem; /* More vertical, less horizontal padding */
    }
    .events-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .event-details-group {
        margin-bottom: 1rem;
    }
    .form-container h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .form-group.full-width {
        grid-column: 1;
    }
    .submit-btn {
        grid-column: 1;
        padding: 0.875rem;
    }
    .cf-turnstile-container {
        padding: 1rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem;
    }
    .header {
        margin-bottom: 1.5rem;
    }
    .logo-image {
        max-width: 140px;
    }
    .header h1 {
        font-size: 1rem;
    }
    .header-occasion {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    .content-wrapper {
        padding: 1.5rem 1rem;
        margin: 0;
    }
    .events-section {
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
    .event-description {
        font-size: 1.3rem;
    }
    .form-container h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .form-grid {
        gap: 0.75rem;
    }
    .form-group {
        margin-bottom: 0;
    }
    input[type="text"], input[type="email"] {
        padding: 0.75rem 0.75rem 0.75rem 35px;
        font-size: 0.95rem;
    }
    .form-icon {
        width: 18px;
        height: 18px;
        left: 8px;
    }
    .checkbox-item {
        padding: 0.75rem;
    }
    .submit-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
    .cf-turnstile-container {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    .form-footer {
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }
}
