/* ============================================
   THEME & TYPOGRAPHY SETUP
   ============================================ */

:root {
    --text-dark: #494846;
    --text-light: #666666;
    --bg-light: #f9f9f9;
    --border-subtle: #e0e0e0;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-duration: 350ms;
}

@font-face {
    font-family: 'Beth Ellen';
    src: url('./assets/fonts/BethEllen.otf') format('opentype');
}

@font-face {
    font-family: 'Karrik';
    src: url('./assets/fonts/karrik.woff2') format('woff2');
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Beth Ellen', serif;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-light);
    background-image: url('./assets/Image/phone.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: fixed;
    inset: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================
   STATE WRAPPER
   ============================================ */

.state-wrapper {
    width: 100%;
    position: relative;
}

/* ============================================
   FORM STATE STYLES
   ============================================ */

.form-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: formEnter var(--animation-duration) var(--transition-timing) forwards;
    opacity: 1;
}

.form-state.exiting {
    animation: formExit var(--animation-duration) var(--transition-timing) forwards;
    opacity: 0;
}

.form-state.hidden {
    display: none;
}

.success-state {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: successEnter var(--animation-duration) var(--transition-timing) forwards;
}

.success-state.active-state {
    display: flex;
    opacity: 1;
    animation: successEnter var(--animation-duration) var(--transition-timing) forwards;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.heading {
    font-family: 'Beth Ellen', serif;
    font-size: clamp(1.05rem, 3vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.3;
    text-align: center;
}

.supporting-copy {
    font-family: 'Beth Ellen', serif;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.5;
    text-align: center;
}

.success-heading {
    font-family: 'Beth Ellen', serif;
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    text-align: center;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: formContentFadeIn 350ms 50ms var(--transition-timing) both;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 50%;
}

.email-input {
    padding: 0.5rem 0.7rem;
    font-size: 0.75rem;
    font-family: 'Karrik', sans-serif;
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    background-color: transparent;
    color: var(--text-dark);
    transition: border-color 200ms ease;
    width: 100%;
}

.email-input:focus {
    outline: none;
    border-color: var(--text-dark);
}

.email-input::placeholder {
    color: #999999;
}

.error-message {
    font-size: 0.525rem;
    color: #d32f2f;
    min-height: 1.2rem;
    line-height: 1;
    display: none;
}

.error-message.visible {
    display: block;
    animation: slideDown 200ms ease;
}

/* ============================================
   CONSENT + TURNSTILE (added for real signups)
   ============================================ */

/* Consent row — matches the light stone theme, sits between input and button */
.consent {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    width: 50%;
    font-family: 'Karrik', sans-serif;
    font-size: 0.6rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.consent input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--text-dark);
    flex-shrink: 0;
    cursor: pointer;
}

.consent span {
    flex: 1;
}

.cf-turnstile {
    min-height: 1px;
}

/* Status line — reuses error styling, adds an OK variant */
.status {
    font-family: 'Karrik', sans-serif;
    font-size: 0.6rem;
    min-height: 1.2rem;
    text-align: center;
    line-height: 1.3;
    color: var(--text-light);
}

.status.err { color: #d32f2f; }
.status.ok  { color: #2e7d32; }

.submit-button {
    padding: 0.5rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Karrik', sans-serif;
    background-color: var(--text-dark);
    color: #F5F1EE;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
    animation: buttonFadeIn 350ms 100ms var(--transition-timing) both;
    width: 50%;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0px);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   SUCCESS STATE STYLES
   ============================================ */

.success-content {
    text-align: center;
    animation: successContentFadeIn 350ms 50ms var(--transition-timing) both;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes formEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes formExit {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

@keyframes formContentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes buttonFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes successEnter {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes successContentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (min-width: 768px) {
    html {
        height: auto;
        overflow: visible;
    }

    body {
        padding: 2rem;
        background-image: url('./assets/Image/desk.webp');
        position: relative;
        inset: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .container {
        max-width: 550px;
    }

    .form {
        gap: 1.25rem;
    }

    .email-input,
    .submit-button {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .form-group,
    .consent,
    .submit-button {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 600px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
