/* ==========================================================================
   Base Styles & Desktop Layout (Your original design)
   ========================================================================== */
body {
    /* Uses your image as a full-page background, centered and scaled to cover the viewport */
    background: #f1f0ea url('/background.png') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Garamond', 'Didot', serif;
    color: #2f3e2d; /* Soft botanical deep green */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background: rgba(253, 251, 247, 0.92); /* Semi-transparent cream matching the image tone */
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
    max-width: 480px; 
    width: 100%;
    border: 1px solid rgba(212, 197, 171, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Added for iOS Safari support */
    box-sizing: border-box;
    overflow: hidden; /* Important: keeps the image corners clipped neatly within the container's rounded edges */
}

.photo-frame {
    text-align: center;
    /* Negative margins cancel out the container's 40px padding to achieve absolute full width */
    margin: -40px -40px 35px -40px; 
    width: calc(100% + 80px); /* Expands the frame container to completely fill the width */
}

.photo-frame img {
    width: 100%; 
    height: 420px; /* Full portrait height */
    /* Only rounds the top corners to seamlessly blend into the top of the white card */
    border-top-left-radius: 14px; 
    border-top-right-radius: 14px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    object-fit: cover; 
    border: none; /* Removed borders so it merges flawlessly with the outer edges */
    display: block; /* Eliminates any ghost inline gaps at the bottom of the image */
}

h1 {
    text-align: center;
    font-size: 32px; 
    letter-spacing: 1.5px;
    margin-bottom: 30px;
    color: #435441; 
    font-weight: normal;
    text-transform: uppercase;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px; 
    letter-spacing: 0.5px;
    color: #556353;
    font-weight: bold;
}

/* Updated selectors to cleanly match your optimized inputs (text, email, number, select) */
input[type="text"], 
input[type="email"], 
input[type="number"], 
select, 
textarea {
    width: 100%;
    padding: 16px; 
    border: 1px solid #c8d1c6;
    border-radius: 8px; 
    background-color: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 17px; /* Kept above 16px to completely eliminate mobile auto-zoom issues */
    color: #2f3e2d;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    height: 52px; /* Large, finger-friendly touch target */
}

/* Custom dropdown arrow for mobile devices because styling overrides strip native ones */
select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='none' stroke='%23556353' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="number"]:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: #798e76; 
    box-shadow: 0 0 8px rgba(121, 142, 118, 0.2); 
}

button, #submit-btn {
    background-color: #61735f; 
    color: white;
    padding: 18px; 
    border: none;
    border-radius: 8px;
    width: 100%;
    font-size: 18px; 
    letter-spacing: 1.5px;
    cursor: pointer;
    margin-top: 15px;
    font-family: inherit;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    height: 56px; /* Large touch target for easy submission */
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover, #submit-btn:hover {
    background-color: #4a5948;
}

button:disabled, #submit-btn:disabled {
    opacity: 0.6;
    background-color: #61735f;
    cursor: not-allowed;
}

#countdown-timer {
    font-family: inherit; 
    color: #556b2f;
}

/* ==========================================================================
   Mobile Responsive Adjustments (Screens 480px wide and smaller)
   ========================================================================== */
@media screen and (max-width: 480px) {
    body {
        padding: 12px; /* Extra screen real estate for small displays */
        align-items: flex-start; /* Avoid layouts looking weird if height changes on keyboard pull-up */
    }

    .container {
        padding: 24px; /* Slightly tighter container padding so input fields remain wide */
    }

    .photo-frame {
        margin: -24px -24px 25px -24px; /* Keeps negative margin tracking perfectly with padding reduction */
        width: calc(100% + 48px);
    }

    .photo-frame img {
        height: 260px; /* Reduced from 420px so users do not have to scroll for miles to find the inputs */
    }

    h1 {
        font-size: 26px; /* Scale text down gracefully */
        margin-bottom: 20px;
    }

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

    label {
        font-size: 15px;
    }

    input[type="text"], 
    input[type="email"], 
    input[type="number"], 
    select, 
    textarea {
        padding: 12px;
        font-size: 16px; /* Keeps input text easy to read while retaining anti-zoom safety markers */
        height: 48px;
    }

    button, #submit-btn {
        padding: 14px;
        font-size: 16px;
        height: 50px;
    }
}
