/* style.css */

/* Define Global Variables */
:root {
    /* Brand Colors */
    --brand-50: #fffbf5;
    --brand-100: #faedd9;
    --brand-200: #D2C8B6;
    --brand-300: #F2B06A;
    --brand-400: #f2983d;
    --brand-500: #F18820;
    /* Primary orange */
    --brand-600: #d97213;
    --brand-900: #7a3b05;
    --brand-500-10: rgba(241, 136, 32, 0.1);
    --brand-600-10: rgba(217, 114, 19, 0.1);
    --brand-500-20: rgba(241, 136, 32, 0.2);
    --brand-500-25: rgba(241, 136, 32, 0.25);

    /* System Colors */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-900: #0f172a;
    --green-50: #f0fdf4;
    --green-500: #22c55e;
    --red-500: #ef4444;
    --white: #ffffff;
    --bg-page: #F0EBE0;

    /* Fonts & Radii */
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-xl: 0.75rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
}

/* Base Resets & Layout */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.site-body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--slate-900);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    line-height: 1.5;

    /* Prevent text selection */
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* Standard */
}

::selection {
    background-color: var(--brand-500);
    color: var(--white);
}

/* Background Blobs */
.bg-decoration {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    width: 50%;
    height: 50%;
    border-radius: var(--radius-full);
    filter: blur(120px);
}

.blob-top-right {
    top: -20%;
    right: -10%;
    background-color: var(--brand-500-10);
}

.blob-bottom-left {
    bottom: -20%;
    left: -10%;
    background-color: var(--brand-600-10);
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main Card */
.main-card {
    width: 100%;
    max-width: 36rem;
    /* max-w-xl */
    background-color: var(--white);
    border-radius: 3rem;
    /* matched roughly to the logo inner radius */
    box-shadow: 0 45px 100px -20px rgba(241, 136, 32, 0.4);
    padding: 1.5rem 2rem 2rem 2rem;
    /* reduced top padding */
    z-index: 10;
    border: 1px solid var(--slate-100);
    position: relative;
}

@media (min-width: 640px) {
    .main-card {
        padding: 2rem 3rem 3rem 3rem;
        /* reduced top padding */
        border-radius: 4rem;
        /* larger radius for desktop to match logo */
    }
}

/* Shared utility states for JS */
.hidden {
    display: none !important;
}

.flex-center {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.opacity-0 {
    opacity: 0;
}

/* Form Container Layout */
.view-container {
    transition: all 0.5s ease-in-out;
}

.header-section {
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.lang-switcher {
    display: flex;
    gap: 0.25rem;
    background-color: var(--slate-50);
    padding: 0.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    flex-shrink: 0;
    margin-left: auto;
    width: fit-content;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--slate-500);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--slate-900);
}

.lang-btn.active {
    background-color: var(--white);
    color: var(--brand-600);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
    .header-section {
        margin-bottom: 2rem;
    }
}

.hero-image {
    width: 110%;
    max-width: 120%;
    height: auto;
    margin-top: 0;
    /* pulls the logo up */
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 12px 12px rgba(241, 136, 32, 0.18));
    object-fit: contain;

    /* Prevent dragging */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
    /* Stops right-clicks and interactions entirely */
}

@media (min-width: 640px) {
    .hero-image {
        margin-top: 0;
        /* pulls the logo up more on larger screens */
        margin-bottom: 1rem;
    }
}

.subtitle {
    color: var(--slate-500);
    font-size: 0.875rem;
    /* text-sm */
    line-height: 1.625;
    /* leading-relaxed */
    padding: 0 0.5rem;
    margin-top: 0.75rem;
    /* pushes it away from the logo */
}

@media (min-width: 640px) {
    .subtitle {
        font-size: 1rem;
        margin-top: 1rem;
    }
}

.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* space-y-6 */
}

/* Form Groups and Inputs */
.form-group {
    position: relative;
}

.input-wrapper {
    position: relative;
}

.form-input {
    display: block;
    width: 100%;
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    background-color: var(--slate-50);
    padding: 0.875rem 1rem;
    /* py-3.5 px-4 */
    padding-right: 2.5rem;
    /* pr-10 */
    color: var(--slate-900);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

@media (min-width: 640px) {
    .form-input {
        font-size: 1rem;
    }
}

.form-input::placeholder {
    color: var(--slate-400);
}

.form-input:focus {
    border-color: var(--brand-500);
    background-color: var(--white);
    box-shadow: 0 0 0 2px var(--brand-500-20);
}

.input-icon {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding-right: 1rem;
    pointer-events: none;
    color: var(--slate-400);
}

.icon-mail {
    height: 1.25rem;
    width: 1.25rem;
}

/* Consents */
.consent-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* space-y-4 */
}

.consent-row-with-lang {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Keeps multi-line checkbox text aligned at the top */
    gap: 1rem;
    margin-top: -0.5rem;
    /* Pulls both the text and the buttons up uniformly */
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    /* gap-3 */
    cursor: pointer;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    height: 1.25rem;
    margin-top: 0.125rem;
}

.consent-text {
    font-size: 0.875rem;
    color: var(--slate-600);
    transition: color 0.15s;
}

.consent-label:hover .consent-text {
    color: var(--slate-900);
}

.text-link {
    color: var(--brand-600);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* Custom Modern Checkbox */
.custom-checkbox {
    appearance: none;
    background-color: var(--white);
    margin: 0;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid var(--slate-400);
    /* Adjusted border to match typical forms */
    border-radius: 0.25em;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    background-color: white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
    background-color: var(--brand-500);
    border-color: var(--brand-500);
}

.custom-checkbox:checked::before {
    transform: scale(1);
}

.custom-checkbox:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* Submit Button */
.btn-primary {
    width: 100%;
    border-radius: var(--radius-xl);
    background-color: var(--brand-600);
    border: none;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--white);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* shadow-sm */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    user-select: none;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--brand-500);
    box-shadow: 0 10px 15px -3px var(--brand-500-25), 0 4px 6px -4px var(--brand-500-25);
    /* hover:shadow-lg hover:shadow-brand-500/25 */
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--brand-600);
    /* Keep it looking right but faded */
    transform: translateY(0);
}

/* Spinner Animation */
.spinner {
    animation: spin 1s linear infinite;
    height: 1rem;
    width: 1rem;
    color: var(--white);
    margin-left: -0.25rem;
    margin-right: 0.5rem;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner-track {
    opacity: 0.25;
}

.spinner-head {
    opacity: 0.75;
}

/* Error Message */
.error-message {
    color: var(--red-500);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* Success Message Container */
.success-container {
    text-align: center;
    padding: 1.5rem 0;
    /* py-6 */
}

.success-icon-wrapper {
    width: 4rem;
    height: 4rem;
    background-color: var(--green-50);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.success-icon {
    width: 2rem;
    height: 2rem;
    color: var(--green-500);
}

.title {
    font-size: 1.5rem;
    /* text-2xl */
    font-weight: 700;
    letter-spacing: -0.025em;
    /* tracking-tight */
    color: var(--slate-900);
    margin-bottom: 0.5rem;
}

/* Success Message Animation */
.success-animate {
    animation: scaleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUp {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Privacy Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    /* slate-900 with opacity */
    backdrop-filter: blur(4px);
    z-index: 100;
    padding: 1rem;
}

.modal-card {
    background-color: var(--white);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 32rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    user-select: text;
    /* Re-enable selection here so they can read/copy policy */
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--slate-100);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--slate-400);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
    padding: 0.25rem;
}

.close-btn:hover {
    color: var(--slate-900);
}

.modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: var(--slate-600);
    font-size: 0.875rem;
    line-height: 1.6;
}

.modal-section strong {
    display: block;
    color: var(--slate-900);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}