/* ============ RESET & BASE ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #e2e8f0;
    background: #050b1f;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(30,75,168,0.35), transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(14,44,102,0.55), transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(56,189,248,0.12), transparent 60%),
        linear-gradient(180deg, #050b1f 0%, #08153a 50%, #050b1f 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ============ STARS ============ */
body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        radial-gradient(1px 1px at 12% 18%, #fff, transparent),
        radial-gradient(1px 1px at 28% 72%, #fff, transparent),
        radial-gradient(1px 1px at 47% 33%, #fff, transparent),
        radial-gradient(1px 1px at 63% 88%, #fff, transparent),
        radial-gradient(1px 1px at 81% 12%, #fff, transparent),
        radial-gradient(1px 1px at 92% 56%, #fff, transparent),
        radial-gradient(1px 1px at 5% 50%, #fff, transparent),
        radial-gradient(1px 1px at 35% 5%, #fff, transparent),
        radial-gradient(1px 1px at 70% 45%, #fff, transparent),
        radial-gradient(1px 1px at 18% 92%, #fff, transparent),
        radial-gradient(1px 1px at 55% 60%, #fff, transparent),
        radial-gradient(1px 1px at 88% 78%, #fff, transparent),
        radial-gradient(1px 1px at 40% 84%, #fff, transparent),
        radial-gradient(1px 1px at 75% 22%, #fff, transparent),
        radial-gradient(1px 1px at 22% 38%, #fff, transparent);
    background-size: 100% 100%;
    opacity: 0.85;
    animation: twinkle 4s ease-in-out infinite;
}

body::after {
    background-image:
        radial-gradient(1.5px 1.5px at 8% 24%, #cfe3ff, transparent),
        radial-gradient(1.5px 1.5px at 32% 12%, #ffe7b8, transparent),
        radial-gradient(2px 2px at 50% 78%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 67% 28%, #cfe3ff, transparent),
        radial-gradient(2px 2px at 84% 64%, #ffd5a8, transparent),
        radial-gradient(1.5px 1.5px at 15% 66%, #fff, transparent),
        radial-gradient(2px 2px at 95% 38%, #cfe3ff, transparent),
        radial-gradient(1.5px 1.5px at 44% 48%, #fff, transparent),
        radial-gradient(2px 2px at 25% 88%, #ffe7b8, transparent),
        radial-gradient(1.5px 1.5px at 78% 90%, #fff, transparent);
    background-size: 100% 100%;
    opacity: 0.7;
    animation: twinkle 6s ease-in-out infinite reverse;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.95; }
}

.page {
    position: relative;
    z-index: 1;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ============ LAYOUT ============ */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ HERO ============ */
.hero {
    position: relative;
    background: transparent;
    color: #fff;
    padding: 32px 0 28px;
    text-align: center;
}

.hero .container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.18);
    margin: 0;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15,23,42,0.22);
}

.logo-img {
    display: block;
    height: 48px;
    width: auto;
    max-width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    margin-bottom: 28px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.stat {
    text-align: center;
}

.stat-num {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============ FORM SECTION ============ */
.form-section {
    flex: 1;
    background: transparent;
    padding: 0 0 48px;
    position: relative;
    margin-top: 0;
    z-index: 2;
}

.form-card {
    background: #fff;
    border-radius: 24px;
    padding: 30px 24px;
    box-shadow:
        0 30px 80px -20px rgba(56,189,248,0.25),
        0 16px 40px -16px rgba(14,44,102,0.6),
        0 0 0 1px rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.form-desc {
    font-size: 14px;
    color: #64748b;
}

/* ============ FIELDS ============ */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    color: #0f172a;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.field input::placeholder {
    color: #94a3b8;
}

.field input:hover {
    border-color: #cbd5e1;
}

.field input:focus {
    outline: none;
    background: #fff;
    border-color: #0e2c66;
    box-shadow: 0 0 0 4px rgba(14,44,102,0.12);
}

.field.invalid input {
    border-color: #ef4444;
    background: #fef2f2;
}

.field.invalid input:focus {
    box-shadow: 0 0 0 4px rgba(239,68,68,0.1);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.field-error {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    font-weight: 500;
    min-height: 16px;
}

/* ============ SUBMIT BUTTON ============ */
.submit-btn {
    width: 100%;
    padding: 16px 20px;
    margin-top: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0e2c66 0%, #1e4ba8 100%);
    border-radius: 12px;
    position: relative;
    transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 20px rgba(14,44,102,0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
}

.submit-btn:hover:not(:disabled) {
    box-shadow: 0 12px 28px rgba(14,44,102,0.4);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.submit-btn .btn-text {
    transition: opacity 0.2s;
}

.submit-btn .btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    display: flex;
}

/* ============ FORM STATUS ============ */
.form-status {
    margin-top: 14px;
    padding: 0;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s, padding 0.3s, margin 0.3s;
}

.form-status.show {
    padding: 12px 14px;
    max-height: 100px;
}

.form-status.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.form-status.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.form-note {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ============ FEATURES ============ */
.features {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #0e2c66;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.feature-text {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

/* ============ MODAL ============ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: slideUp 0.3s ease;
}

.modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.modal-content p {
    font-size: 14px;
    color: #64748b;
}

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

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

/* ============ RESPONSIVE - LARGER SCREENS ============ */
@media (min-width: 640px) {
    .container {
        max-width: 560px;
        padding: 0 24px;
    }

    .hero {
        padding: 40px 0 32px;
    }

    .hero-title {
        font-size: 44px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .stat-num {
        font-size: 24px;
    }

    .form-card {
        padding: 36px 32px;
    }

    .form-title {
        font-size: 26px;
    }

    .features {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .feature {
        flex: 1 1 calc(50% - 6px);
    }
}

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

    .hero {
        padding: 56px 0 36px;
    }

    .hero .container {
        max-width: 700px;
        gap: 22px;
    }

    .logo-img {
        height: 56px;
    }

    .form-section {
        margin-top: 0;
    }

    .form-section .container {
        max-width: 560px;
    }

    .features {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .feature {
        flex: 1 1 calc(33.333% - 8px);
    }
}

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