:root {
    --bg-color: #FFEEDD;
    --text-color: #2C2A31;
    --input-bg: #ffffff;
    --border-color: #2C2A31;
    --toggle-bg: #e0e0e0;
    --toggle-slider: #2C2A31;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #2C2A31;
        --text-color: #FFEEDD;
        --input-bg: #3a3840;
        --border-color: #FFEEDD;
        --toggle-bg: #4a4850;
        --toggle-slider: #FFEEDD;
    }
}

[data-theme="light"] {
    --bg-color: #FFEEDD;
    --text-color: #2C2A31;
    --input-bg: #ffffff;
    --border-color: #2C2A31;
    --toggle-bg: #e0e0e0;
    --toggle-slider: #2C2A31;
}

[data-theme="dark"] {
    --bg-color: #2C2A31;
    --text-color: #FFEEDD;
    --input-bg: #3a3840;
    --border-color: #FFEEDD;
    --toggle-bg: #4a4850;
    --toggle-slider: #FFEEDD;
}

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

body {
    font-family: 'Alan Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: var(--toggle-bg);
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 3px;
    transition: background-color 0.3s ease;
}

.toggle-slider {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: var(--toggle-slider);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle.dark .toggle-slider {
    transform: translateX(30px);
}

.theme-icon {
    position: absolute;
    font-size: 14px;
    color: var(--bg-color);
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    left: 6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle.dark .theme-icon {
    left: 36px;
}

.container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 0;
}

@media (min-width: 1200px) {
    .container {
        max-width: 800px;
    }
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 40px;
    opacity: 0.8;
}

.email-form {
    display: flex;
    align-items: stretch;
    max-width: 400px;
    margin: 0 auto;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    background-color: var(--input-bg);
    transition: all 0.3s ease;
}

.email-form:focus-within {
    box-shadow: 0 0 0 3px var(--border-color);
    /*opacity: 0.3;*/
}



.email-input {
    flex: 1;
    padding: 16px 20px;
    max-width: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    font-family: 'Alan Sans', system-ui, -apple-system, sans-serif;
    outline: none;
    align-self: stretch;
    transition: max-width 0.3s ease, padding 0.3s ease;
}

.email-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.submit-btn {
    padding: 0 20px;
    border: none;
    background: var(--text-color);
    color: var(--bg-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    align-self: stretch;
    min-height: 100%;
    width: 70px
}

.submit-btn:hover {
    opacity: 0.8;
}

.submit-btn .material-icons {
    font-size: 20px;
    transition: transform 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.submit-btn .material-icons.sent-icon {
    opacity: 0;

}

.email-form.loading, .email-form.success {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    flex: initial;
}

.email-form.loading .submit-btn span {
    transform: scale(0.5) translate(0%, 100%);
    animation: loading-plane 1s infinite 0.3s;
    transform-origin: 50% -5px;
}

.email-form.success .submit-btn .send-icon {
    opacity: 0;
}
.email-form.success .submit-btn .sent-icon {
    opacity: 1;
}
@keyframes loading-plane {
    0% {
        transform: scale(0.5) translate(0%, 100%) rotate(0deg);
    }
    100% {
        transform: scale(0.5) translate(0%, 100%) rotate(-360deg);
    }
}


@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .email-form {
        max-width: 100%;
    }

    .theme-toggle-container {
        top: 15px;
        right: 15px;
    }
}