:root {
    --bg-color: #050508;
    --text-color: #ffffff;
    --text-muted: #a0a0b0;
    --accent-glow: rgba(100, 100, 255, 0.2);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: rgba(255, 255, 255, 0.25);
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --planet-horizon: #1c1c3a;

    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background & Animations */
.background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.planet-horizon {
    position: absolute;
    bottom: -60vh;
    left: -50%;
    width: 200%;
    height: 100vh;
    background: radial-gradient(circle at 50% 0%, #1a1a30 0%, #000000 70%);
    border-radius: 50%;
    box-shadow: 0 -20px 100px rgba(60, 80, 255, 0.15);
    opacity: 0.9;
}

.planet-glow {
    position: absolute;
    bottom: -100px;
    left: 0;
    width: 100%;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(80, 100, 255, 0.25) 0%, transparent 70%);
    pointer-events: none;
    animation: pulseGlow 4s ease-in-out infinite;
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 4px 2px rgba(255, 255, 255, 0.8);
    animation: shootingStar 3s ease-out forwards;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(2px);
}

@keyframes shootingStar {
    from {
        transform: translate(0, 0);
        opacity: 1;
    }

    to {
        transform: translate(-300px, 300px);
        opacity: 0;
    }
}

@keyframes pulseGlow {

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

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Logo Header */
.logo-header {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    animation: logoFadeIn 1s ease-out;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.logo-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.6rem 1.2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}

/* Liquid glass shine effect */
.logo-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 70%);
    animation: liquidShine 8s ease-in-out infinite;
}

.logo-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 20px rgba(100, 100, 255, 0.1);
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    display: inline-block;

    /* Liquid glass text effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(180, 190, 255, 0.95) 30%,
            rgba(255, 255, 255, 0.9) 60%,
            rgba(200, 210, 255, 0.95) 100%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Glass text shadow for depth */
    filter: drop-shadow(0 0 20px rgba(100, 120, 255, 0.3)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));

    animation: liquidTextFlow 6s ease-in-out infinite;
}

/* Flowing liquid effect on text gradient */
@keyframes liquidTextFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Beta Badge */
.beta-badge {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    background: rgba(100, 120, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 120, 255, 0.3);
    border-radius: 6px;
    color: rgba(180, 190, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(100, 120, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 2;
    animation: betaPulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes betaPulse {

    0%,
    100% {
        box-shadow:
            0 2px 8px rgba(100, 120, 255, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow:
            0 4px 12px rgba(100, 120, 255, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

@keyframes liquidShine {

    0%,
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(50%, 50%) rotate(180deg);
    }
}

/* Layout */
.content-wrapper {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10rem;
}

/* Hero Text */
.hero-text {
    margin-top: auto;
    margin-bottom: auto;
}

/* Typography */
h1 {
    font-size: 4rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    padding-bottom: 0.2em;
    /* Prevents descender clipping with gradient */
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    display: inline-block;
    /* Essential for background-clip not to cut off descenders */
    line-height: 1.2;
    padding: 0 0.1em 0.2em 0.1em;
    /* Prevents clipping on all sides */
    background: linear-gradient(135deg, #fff 60%, #a0a0ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Styling */
.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* User Type Toggle */
.user-type-toggle {
    display: flex;
    gap: 0;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 0.5rem;
}

.toggle-option {
    flex: 1;
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.toggle-option.active {
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle-option:not(.active):hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.form-group {
    position: relative;
    width: 100%;
}

input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--input-focus);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* Custom Select & Dropdown */
.custom-select,
.country-select {
    position: relative;
    user-select: none;
    cursor: pointer;
}

.select-trigger,
.start-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.select-options,
.country-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1a24;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 20;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select.open .select-options,
.country-select.open .country-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.option {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option:last-child {
    border-bottom: none;
}

.option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.3s;
}

.custom-select.open .arrow,
.country-select.open .arrow {
    transform: rotate(180deg);
}

/* Phone Group Layout */
.phone-group {
    display: flex;
    gap: 10px;
}

.country-select {
    width: 35%;
    min-width: 110px;
}

.phone-group input {
    width: 65%;
    flex-grow: 1;
}

/* Button */
.submit-btn {
    margin-top: 1rem;
    padding: 0.9rem;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}

/* Holographic shimmer effect */
.submit-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s;
}

.submit-btn:hover::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* Glow effect on hover */
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 30px rgba(255, 255, 255, 0.2),
        0 0 20px rgba(100, 100, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Button Loading State */
.submit-btn.loading {
    color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow:
        0 0 30px rgba(102, 126, 234, 0.5),
        0 10px 20px rgba(0, 0, 0, 0.3);
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Particle effect on loading */
.submit-btn.loading::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotateGlow 2s linear infinite;
    border-radius: 8px;
}

.submit-btn.error {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    animation: shake 0.5s ease-in-out;
}

/* Success Message Container */
.success-message {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-message.show {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
    animation: successIconAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: successPulse 2s ease-in-out infinite;
}

.success-icon::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    font-weight: 600;
    z-index: 1;
    animation: checkAppear 0.4s ease-out 0.3s both;
}

.success-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 60%, #a0a0ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.success-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.success-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.success-contact:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(100, 100, 255, 0.2);
}

.success-contact::before {
    content: '✉';
    font-size: 1.2rem;
}

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

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

@keyframes successPulse {

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

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes successIconAppear {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes checkAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Scrollbar for dropdowns */
.select-options::-webkit-scrollbar,
.country-options::-webkit-scrollbar {
    width: 6px;
}

.select-options::-webkit-scrollbar-thumb,
.country-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    -webkit-animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
}

.delay-1 {
    -webkit-animation-delay: 0.2s;
    animation-delay: 0.2s;
}

.delay-2 {
    -webkit-animation-delay: 0.4s;
    animation-delay: 0.4s;
}

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

/* Responsive */
@media (max-width: 768px) {
    .logo-header {
        left: 50%;
        transform: translateX(-50%);
        top: 1rem;
    }

    .logo-container {
        padding: 0.5rem 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .beta-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.4rem;
    }

    h1 {
        font-size: 3rem;
    }

    .content-wrapper {
        padding: 1rem;
        padding-top: 5rem;
        min-height: auto;
        justify-content: flex-start;
    }

    .hero-text {
        margin-top: 0;
        margin-bottom: 1rem;
    }

    .subtitle {
        margin-bottom: 1.5rem;
    }

    /* Disable animation delays on mobile for immediate visibility */
    .fade-in-up {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .delay-1,
    .delay-2 {
        animation-delay: 0s;
    }

    .waitlist-form {
        padding: 1.5rem;
    }

    /* Better touch targets on mobile */
    input,
    .select-trigger,
    .start-trigger {
        padding: 1rem;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 1rem;
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding-top: 4.5rem;
    }

    h1 {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .waitlist-form {
        padding: 1rem;
        gap: 0.75rem;
    }

    .phone-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .country-select,
    .phone-group input {
        width: 100%;
    }

    .waitlist-form {
        padding: 1.25rem;
        border-radius: 16px;
    }

    /* Prevent viewport zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px;
    }
}