/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Apply Poppins everywhere */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    /* Ensure consistent box model */
}

/* ========== General Layout ========== */
.contact-us-section {
    width: 100%;
    min-height: 100vh;
    /* Use min-height for full viewport, svh can be an alternative */
    background: url('../images/contactBg.png') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 5vw, 100px);
    /* Fluid padding */
    position: relative;
    overflow: hidden;
    /* Prevent content from spilling out */
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    /* Allows columns to wrap */
    max-width: 1200px;
    width: 100%;
    background-color: transparent;
    /* Keep background transparent */
    border-radius: 30px;
    overflow: hidden;
    /* Removed direct padding, columns will manage their own */
}

/* ========== Left Column: Contact Info ========== */
.contact-info-col {
    flex: 1;
    /* Allows it to grow/shrink */
    min-width: 300px;
    /* Prevent it from becoming too narrow before wrapping */
    padding: 40px 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: start;
    z-index: 1;
    background-color: transparent;
    /* Ensure consistency */
}

.contact-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    /* Responsive font size */
    color: #0060AA;
    font-weight: 700;
    margin-bottom: 20px;
}

.contact-details p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    /* Responsive font size */
    line-height: 1;
    /* Adjusted for better readability */
    color: #000000;
    font-weight: 500;
    margin-bottom: 8px;
}

.deer-image {
    position: absolute;
    bottom: 0;
    left: 20%;
    width: clamp(200px, 25vw, 350px);
    /* Responsive width */
    z-index: 0;
    max-width: 80%;
    /* Ensure it doesn't move off screen too much */
}

.deer-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== Right Column: Form ========== */
.contact-form-col {
    flex: 1.3;
    /* Slightly larger share */
    min-width: 320px;
    /* Prevent it from becoming too narrow */
    background-color: #EBAC8F66;
    /* Using a slightly transparent background */
    border-radius: 20px;
    padding: clamp(30px, 6vw, 50px) clamp(20px, 5vw, 40px);
    /* Responsive padding */
    position: relative;
}

.form-heading {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: #000000;
    margin-bottom: 30px;
    line-height: 1.6;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Row */
.form-row {
    display: flex;
    flex-wrap: wrap;
    /* Allows inputs to wrap */
    gap: 20px;
}

/* ========== Input Fields ========== */
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 250px;
    /* Ensures input fields don't get too small if they have to share space */
}

.form-group.full-width {
    width: 100%;
    flex: none;
    /* Override flex: 1 for full-width elements */
    min-width: unset;
    /* Don't restrict min-width for full-width */
}

input,
select,
textarea {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background-color: #fff !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    font-family: 'Poppins', sans-serif !important;
    box-sizing: border-box !important;
}

input::placeholder,
textarea::placeholder {
    color: #606060 !important;
}


input:focus,
select:focus,
textarea:focus {
    border-color: #f08a5d;
    box-shadow: 0 0 0 3px rgba(240, 138, 93, 0.2);
    outline: none;
}

select {
    appearance: none;
    /* Remove default dropdown arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2C197.394L146.2%2C56.694L5.4%2C197.394H287z%22%2F%3E%3C%2Fsvg%3E');
    /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========== Captcha ========== */
.captcha-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    /* Allow captcha elements to wrap */
}

.captcha-display {
    background-color: #fce6df;
    padding: 12px 20px;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    /* Responsive font size */
    font-weight: bold;
    color: #d16b4a;
    border-radius: 8px;
    user-select: none;
    letter-spacing: 2px;
    text-align: center;
    flex: 0.5;
    /* Give it less flexible width */
    min-width: 120px;
    box-sizing: border-box;
}

.captcha-input {
    flex: 1.5;
    /* Give it more flexible width */
    min-width: 180px;
    /* Ensure input doesn't get too small */
}

/* ========== OTP ========== */
.mobile-otp-group {
    position: relative;
    display: flex;
    flex-direction: column;
    /* Stack input and buttons */
}

.otp-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* Align buttons to the start */
}

.otp-btn {
    padding: 8px 14px;
    background-color: #f08a5d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent text wrapping inside button */
}

.otp-btn:hover:not(:disabled) {
    background-color: #d76a3c;
}

.otp-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ========== Error Message ========== */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 18px;
    /* Maintain space even when empty */
    display: none;
    /* Initially hidden */
}

.is-invalid {
    border-color: #e74c3c !important;
}

/* ========== Submit Button ========== */
.submit-button {
    background-color: #004aad;
    color: white;
    padding: 14px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
    width: auto;
    /* Allow button to size naturally */
    align-self: flex-start;
    /* Align to the left in column layout */
}

.submit-button:hover:not(:disabled) {
    background-color: #00398c;
    transform: translateY(-2px);
}

.submit-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* ========== Decorative Images ========== */
.penguin-image {
    position: absolute;
    top: 5px;
    right: 12%;
    width: clamp(50px, 8vw, 70px);
    /* Responsive width */
    z-index: 0;
}

.penguin-image img {
    width: 100%;
    height: auto;
}

.flask-image {
    position: absolute;
    bottom: -10px;
    left: 15px;
    width: clamp(40px, 7vw, 60px);
    /* Responsive width */
    opacity: 0.5;
}

.flask-image img {
    width: 100%;
    height: auto;
}

/* =================================== */
/* New Additions for Functionality & UX */
/* =================================== */

/* Spinner for buttons */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: -0.125em;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: .75s linear infinite spinner-border;
    animation: .75s linear infinite spinner-border;
}

@-webkit-keyframes spinner-border {
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes spinner-border {
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* OTP Input Section */
.otp-input-section {
    display: none;
    /* Hidden by default, shown by JS */
    margin-top: -10px;
    /* Adjust spacing */
    position: relative;
    transition: all 0.3s ease-in-out;
}

.otp-input-section.visible {
    display: block;
}

.otp-input-section.verified {
    background-color: #e9f7ef;
    /* Light green background */
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 10px;
    opacity: 0.8;
}

#otpInput {
    margin-bottom: 5px;
}

.otp-timer-display {
    font-size: 0.85rem;
    color: #555;
    margin-top: 5px;
    text-align: right;
    display: none;
}

.otp-timer-display.visible {
    display: block;
}

.otp-btn.countdown-active {
    background-color: #999;
    cursor: not-allowed;
    pointer-events: none;
    /* Fully disable interaction */
}

/* Verified Indicator */
.verified-indicator {
    display: none;
    /* Hidden by default */
    background-color: #28a745;
    /* Green background */
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    position: absolute;
    bottom: -35px;
    /* Adjust as needed */
    right: 0;
    z-index: 10;
    pointer-events: none;
    /* Don't block clicks */
}

.verified-indicator.visible {
    display: inline-block;
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    padding: 5px;
    top: 10%;
    right: 20px;
    z-index: 1000;
    display: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast.info {
    background-color: #17a2b8;
}

#comment {
    max-width: 100%;
}

/* ========== Responsive Breakpoints ========== */

/* Adjustments for medium screens (e.g., tablets in landscape, smaller desktops) */
@media (max-width: 1024px) {
    .contact-container {
        padding: 0;
        /* Let columns handle their own padding */
    }

    .contact-info-col,
    .contact-form-col {
        min-width: unset;
        /* Allow flexibility */
        padding: clamp(25px, 4vw, 45px) clamp(15px, 3vw, 35px);
    }

    .deer-image {
        left: 10%;
        width: clamp(180px, 25vw, 300px);
    }

    .penguin-image {
        right: 5%;
        width: clamp(50px, 7vw, 65px);
    }

    .flask-image {
        left: 5px;
        width: clamp(40px, 6vw, 55px);
    }
}

/* Smaller screens (e.g., tablets in portrait, large phones) - Original 992px breakpoint */
@media (max-width: 992px) {
    .contact-container {
        flex-direction: column;
        border-radius: 15px;
    }

    .contact-info-col,
    .contact-form-col {
        width: 100%;
        padding: clamp(30px, 6vw, 50px) clamp(20px, 5vw, 40px);
        border-radius: 0;
        /* Remove individual column radius when stacked */
    }

    /* Adjust radius for top/bottom column when stacked */
    .contact-info-col {
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        padding-bottom: clamp(20px, 4vw, 30px);
        /* Adjust bottom padding for deer image */
        align-items: center;
        /* Center content when stacked */
        text-align: center;
    }

    .contact-form-col {
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
    }

    .deer-image {
        position: relative;
        /* Change to relative to flow with content */
        bottom: unset;
        left: unset;
        width: clamp(180px, 30vw, 220px);
        /* Responsive width for stacked */
        margin-top: 20px;
        align-self: center;
        /* Center it */
    }

    .penguin-image,
    .flask-image {
        display: none;
        /* Hide decorative images on smaller screens */
    }

    .form-row {
        flex-direction: column;
        /* Stack form inputs */
        gap: 15px;
        /* Slightly less gap */
    }

    .form-group {
        min-width: unset;
        /* Allow to be full width */
    }

    .captcha-row {
        flex-direction: column;
        align-items: stretch;
        /* Stretch captcha elements to full width */
    }

    .captcha-display,
    .captcha-input {
        width: 100%;
        flex: none;
        /* Reset flex values */
        min-width: unset;
    }

    .submit-button {
        align-self: center;
        /* Center button when stacked */
        width: 80%;
        /* Make it wider */
        max-width: 300px;
    }
}

/* Very small screens (e.g., mobile phones) - Original 480px breakpoint */
@media (max-width: 480px) {
    .contact-us-section {
        padding: 15px;
        /* Smaller overall padding */
    }

    .contact-title {
        font-size: clamp(1.6rem, 7vw, 2rem);
        /* Even more responsive title */
    }

    .contact-details {
        text-align: center;
    }

    .contact-info-col,
    .contact-form-col {
        padding: clamp(20px, 8vw, 30px) clamp(15px, 6vw, 25px);
        /* More compact padding */
    }

    .deer-image {
        width: clamp(150px, 40vw, 180px);
        /* Smaller deer image */
        margin-top: 15px;
    }

    .otp-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        /* Center buttons */
    }

    .otp-btn {
        width: 100%;
        /* Full width buttons */
        max-width: 200px;
        /* Max width for readability */
    }

    .submit-button {
        width: 100%;
        /* Full width submit button */
        max-width: none;
        /* Override max-width */
    }

    input,
    select,
    textarea {
        font-size: 0.95rem;
        /* Slightly smaller font for inputs */
    }

    .form-heading {
        font-size: 0.9rem;
    }
}

/* Additional breakpoint for very large screens */
@media (min-width: 1600px) {
    .contact-us-section {
        padding: 150px;
        /* More padding on very large screens */
    }

    .contact-container {
        max-width: 1400px;
        /* Allow wider container */
    }

    .deer-image {
        left: 25%;
        width: 400px;
    }

    .penguin-image {
        top: 50px;
        right: 15%;
        width: 90px;
    }

    .flask-image {
        bottom: -20px;
        left: 20px;
        width: 80px;
    }
}