:root {
    --primary: #FF385C;
    /* Original Pink/Red */
    --clay-orange: #F25822;
    /* User requested Clay/Orange tone */
    --bg-light: #f3f4f6;
    --text-dark: #1f2937;
    --text-gray: #4b5563;
}

/* Import Font directly here as backup */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
    background: radial-gradient(circle at center, #ffffff 0%, #e0e2e5 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem;
}

/* Character Images */
.char-img {
    position: absolute;
    z-index: 1;
    opacity: 1;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.15));
    pointer-events: none;
}

.char-left-top {
    top: 50%;
    left: -2%;
    /* Symmetric */
    transform: translateY(-50%) scale(1.1);
    width: 450px;
}

.char-right-top {
    top: 50%;
    right: -2%;
    /* Symmetric */
    transform: translateY(-50%) scale(1.1);
    width: 480px;
    /* Keeping size slightly different for variety is ok, but pos should correspond */
}

.char-bottom-left {
    bottom: -50px;
    left: 10%;
    width: 380px;
}

.char-bottom-right {
    bottom: -50px;
    right: 10%;
    width: 400px;
}

/* Float Animation */
@keyframes slight-float {

    0%,
    100% {
        transform: translateY(-50%) translateY(0) scale(1.1);
    }

    50% {
        transform: translateY(-50%) translateY(-15px) scale(1.1);
    }
}

.char-left-top,
.char-right-top {
    animation: slight-float 6s ease-in-out infinite;
}

.container {
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    /* Flex centering */
    justify-content: center;
    text-align: center;
    margin-inline: auto;
    /* Force layout centering */
}

/* Logo & Header */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
    /* Ensure full width for centering */
}

.logo-img {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(242, 88, 34, 0.3));
    animation: float-logo 4s ease-in-out infinite;
}

@keyframes float-logo {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--clay-orange);
    /* Changed to Clay Orange */
    letter-spacing: -1px;
    text-transform: uppercase;
    line-height: 1;
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #1a1a1a;
    text-align: center;
    /* Explicitly centered */
}

.subtitle {
    color: #4a4a4a;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.4;
    max-width: 80%;
    margin-inline: auto;
    /* Ensure text block itself is centered if max-width kicks in */
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    max-width: 450px;
    margin-inline: auto;
    /* Double ensure form container is centered */
}

.input-group {
    display: flex;
    gap: 1rem;
    width: 100%;
    /* Ensure full width used */
}

.input-group input {
    flex: 1;
    /* Fixes gap issue: shares space equally instead of forcing 50%+50%+gap */
    width: auto;
}

input {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    padding: 1.2rem;
    border-radius: 12px;
    /* Clay style rounded */
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    /* Soft shadow */
}

input::placeholder {
    color: #9ca3af;
}

input:focus {
    border-color: var(--clay-orange);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(242, 88, 34, 0.1), 0 4px 6px -2px rgba(242, 88, 34, 0.05);
}

button {
    background-color: var(--clay-orange);
    color: white;
    padding: 1.2rem;
    border: none;
    border-radius: 0 !important; border-left: none; border-right: none;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(242, 88, 34, 0.3), 0 4px 6px -2px rgba(242, 88, 34, 0.1);
    margin-top: 0.5rem;
    /* Clay 3D effect border top highlight */
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(242, 88, 34, 0.4), 0 10px 10px -5px rgba(242, 88, 34, 0.2);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(-1px);
}

/* Utility */
.hidden {
    display: none;
}

#successMessage {
    margin: 2rem 0 2rem 0 !important;
    color: #16a34a;
    font-weight: 700;
    background: #dcfce7;
    padding: 1rem;
    border-radius: 12px;
}

#errorMessage {
    margin: 2rem 0 2rem 0 !important;
    color: #dc2626;
    font-weight: 700;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    margin-top: 4rem;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1024px) {

    /* Tablet & Medium Screens: Make images smaller */
    .char-left-top {
        width: 300px;
        left: -10%;
    }

    .char-right-top {
        width: 320px;
        right: -5%;
    }

    .char-bottom-left {
        width: 250px;
    }

    .char-bottom-right {
        width: 260px;
    }

    h1 {
        font-size: 3rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        overflow-x: hidden;
        position: relative;
    }

    body {
        justify-content: flex-start;
        padding: calc(4rem + env(safe-area-inset-top)) 0 0 0 !important;
        /* Allow scrolling if content is tall */
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .container {
        padding: 1.5rem 1rem;
        /* Less side padding */
        width: 100% !important;
        /* Slightly reduce width to ensure margins */
        max-width: 100% !important;
        margin: 2rem 0 2rem 0 !important;
        margin-bottom: 2rem;

        /* Glassmorphism for Mobile */
        background: rgba(255, 255, 255, 0.75);
        /* Increased opacity for better readability */
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-radius: 0 !important; border-left: none; border-right: none;
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

        z-index: 10;
        /* Above images */
    }

    h1 {
        font-size: 1.8rem;
        /* Smaller for better fit */
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    /* Reposition images for mobile flow - Behind the glass */
    .char-img {
        z-index: 0;
        /* Behind container */
        opacity: 0.8;
    }

    .char-left-top {
        display: block;
        width: 250px;
        top: 2%;
        left: -40px;
        transform: none;
        animation: none;
    }

    .char-bottom-right {
        display: block;
        width: 280px;
        bottom: 2%;
        /* Stick to bottom */
        right: -50px;
        top: auto;
        transform: scaleX(-1);
        /* Flip */
    }

    /* Hide others */
    .char-right-top,
    .char-bottom-left {
        display: none;
    }

    form {
        width: 100%;
        padding: 0 0.2rem;
        /* Safe breathing room */
    }

    .input-group {
        flex-direction: column;
        gap: 0.8rem;
    }

    .input-group input {
        width: 100%;
    }

    input {
        padding: 1rem;
        /* Slightly reduced padding */
        font-size: 16px !important;
        /* Force 16px to prevent iOS auto-zoom */
    }

    /* reCAPTCHA responsive fix */
    .g-recaptcha {
        transform: scale(0.85);
        /* Scale down slightly for narrow screens */
        transform-origin: center;
        margin-bottom: 0.5rem !important;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    /* High z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-visual {
    width: 250px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 10px 20px rgba(242, 88, 34, 0.2));
}

.modal-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--clay-orange);
    margin-bottom: 0.5rem;
}

.modal-text {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-close-btn {
    background-color: var(--clay-orange);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(242, 88, 34, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(242, 88, 34, 0.4);
}