/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    overflow: hidden; /* No scroll */
    background-color: #ffffff;
    height: 100vh;
    width: 100vw;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* --- Layout --- */
.main-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Panel (Image) */
.left-panel {
    /* Desktop: Variable width based on image aspect ratio */
    width: auto;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Picture & Img styling */
.left-panel picture {
    display: block;
    height: 100%;
    width: auto;
}

.left-panel img {
    /* Desktop: Height 100%, Width Auto -> Maintains Aspect Ratio without crop */
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    max-width: none; /* Ensure it can expand freely */
}

/* Right Panel (Content) */
.right-panel {
    /* Desktop: Take remaining space */
    flex: 1; 
    height: 100%;
    background: #fff;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute vertical space */
    padding: 40px;
    text-align: center;
    min-width: 300px; /* Prevent it from disappearing completely */
}

/* Typography Helpers */
.text-red {
    color: #cc0000;
}

/* Header Info */
.header-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.info-left {
    text-align: left;
}

.info-right {
    text-align: right;
}

/* Dress Code */
.dress-code {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 20px;
}

/* Main Title */
.main-title {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 150px; /* Increased from 120px */
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 40px 0; /* Increased margin for spacing */
}

/* Form Wrapper */
.form-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Pill Input */
.pill-input {
    width: 100%;
    padding: 15px 25px;
    background: #e0e0e0; /* Grey */
    border: none;
    border-radius: 50px; /* Pill shape */
    font-size: 18px;
    color: #333;
    outline: none;
    text-align: left; /* Aligned left */
    margin-bottom: 10px; /* Reduced space between input and checkbox */
    transition: background 0.3s;
}

.pill-input::placeholder {
    color: #777;
}

.pill-input:focus {
    background: #d0d0d0;
}

/* Checkbox Styling */
.checkbox-container {
    margin-bottom: 40px; /* Increased spacing below checkbox group */
    display: flex;
    justify-content: flex-start; /* Aligned left */
    padding-left: 10px; /* Slight indent to align nicely with pill input text area */
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px; /* Smaller font */
    font-weight: 500;
    user-select: none;
    /* Background removed */
    background-color: transparent; 
    padding: 0;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 16px; /* Smaller checkmark box */
    width: 16px;
    background-color: #fff;
    border: 1px solid #333; /* Add border for visibility */
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #cc0000; /* Red when checked */
    border-color: #cc0000;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 4px; /* Adjusted for border */
    top: 1px; /* Adjusted for border */
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: #000; /* Black text */
}

/* Buttons */
.buttons-container {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-pill {
    flex: 1; /* Ensure equal width */
    padding: 15px;
    border: none;
    border-radius: 50px; /* Pill shape */
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-transform: none; /* Remove uppercase transformation */
    color: #fff;
    transition: transform 0.1s, filter 0.2s;
}

/* Capitalize first letter only */
.btn-pill::first-letter {
    text-transform: uppercase;
}

.btn-pill:active {
    transform: scale(0.96);
}

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

.btn-red {
    background: #cc0000;
}

.btn-grey {
    background: #444;
}

/* Footer */
.footer-section {
    margin-top: 20px;
    font-size: 16px; /* Increased size */
    color: #000;
    line-height: 1.4;
    font-weight: 700; /* Bold */
}

.footer-text {
    margin-bottom: 15px;
}

.donate-btn {
    display: inline-block;
    padding: 10px 30px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    transition: background 0.3s;
}

.donate-btn:hover {
    background: #333;
}

#message {
    margin-top: 15px;
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-box p {
    color: #000;
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 700;
    text-transform: uppercase;
}

.buttons-container-modal {
    display: flex;
    gap: 15px;
}


/* --- Mobile (No Scroll, Full Height) --- */
@media screen and (max-width: 768px) {
    .main-container {
        position: relative;
        display: block; /* Stack or Overlay */
    }

    .left-panel {
        width: 100%;
        height: 100%;
        position: absolute; /* Background layer */
        top: 0;
        left: 0;
        z-index: 1;
    }

    /* Reset Img behavior for Mobile Overlay */
    .left-panel picture, .left-panel img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Back to cover for mobile */
    }

    .right-panel {
        width: 100%;
        height: 100%; /* Cover full screen */
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
        background: rgba(255, 255, 255, 0.5); /* 50% opacity */
        backdrop-filter: blur(10px); /* Glass effect */
        -webkit-backdrop-filter: blur(10px); /* Safari support */
        padding: 15px 20px 20px 20px; /* Reduced top/bottom padding */
        /* Flex adjustments for tight space */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* Adjust typography for mobile fitting */
    .header-info {
        font-size: 14px; /* Smaller header text */
        margin-bottom: 0;
        flex-shrink: 0; /* Don't shrink */
    }

    .dress-code {
        font-size: 18px;
        margin-top: auto; /* Push down from header */
        margin-bottom: 10px;
    }

    .main-title {
        font-size: 110px; /* Adjusted to 110px as requested */
        margin: 0 0 15px 0;
        line-height: 0.9;
    }

    .form-wrapper {
        margin-top: 10px;
        margin-bottom: auto; /* Push up from footer */
        width: 100%; /* Ensure full width usage */
    }

    .pill-input {
        padding: 12px 20px;
        font-size: 16px;
        margin-bottom: 15px;
    }

    /* Buttons Mobile */
    .buttons-container {
        width: 100%; /* Ensure container takes full width */
        gap: 10px; /* Slightly tighter gap on mobile */
    }

    .btn-pill {
        padding: 12px;
        font-size: 16px;
        flex: 1; /* Ensure equal width */
        width: 100%; /* Force width */
    }

    .footer-section {
        margin-top: 0; 
        flex-shrink: 0; /* Don't shrink */
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-text {
        font-size: 16px; /* Match button text size (16px) */
        margin-bottom: 15px;
        line-height: 1.3;
    }

    .donate-btn {
        padding: 12px 0; /* Match vertical padding of other buttons */
        font-size: 16px; /* Match font size */
        width: 100%; /* Full width like other buttons */
        text-align: center;
        display: block; /* Ensure block behavior for width */
    }
}

/* Very Small Screens */
@media screen and (max-width: 380px) {
    .main-title { font-size: 60px; }
    .right-panel { padding: 15px; }
}