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

:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --blue-950: #0F1F38;
    --blue-900: #1A365D;
    --blue-800: #1E3A5F;
    --blue-600: #2B6CB0;
    --blue-hover: #2C5282;
    --blue-50: #EBF8FF;
    --card: #FFFFFF;
    --text: #1A202C;
    --text-2: #4A5568;
    --text-3: #A0AEC0;
    --green: #38A169;
    --green-bg: #F0FFF4;
    --gold: #ECC94B;
    --border: #E2E8F0;
    --border-focus: #2B6CB0;
    --error: #E53E3E;
    --radius: 16px;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
    background: #0D1B2E;
    position: relative;
    overflow-x: hidden;
}

/* ===== BACKGROUND HERO ===== */
.bg-hero {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(170deg, #0D1B2E 0%, #152A46 35%, #1A365D 50%, #E8EDF3 50.1%, #F0F4F8 100%);
}

.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(43,108,176,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    top: 0;
    height: 50%;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* ===== PAGE ===== */
.page {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* ===== CARD ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.06),
        0 4px 6px rgba(0,0,0,0.04),
        0 20px 60px rgba(0,0,0,0.12),
        0 0 80px rgba(43,108,176,0.06);
    overflow: hidden;
    animation: cardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* ===== HEADER ===== */
.card-header {
    background: linear-gradient(165deg, var(--blue-900) 0%, var(--blue-800) 100%);
    color: white;
    padding: 30px 30px 26px;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
    background: rgba(255,255,255,0.05);
}

h1 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -0.025em;
}

.h1-accent {
    color: #90CDF4;
}

.h1-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    margin-top: 10px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* ===== SOCIAL PROOF ===== */
.social-proof {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 30px;
    background: var(--blue-50);
    border-bottom: 1px solid var(--border);
}

.avatars {
    display: flex;
    flex-shrink: 0;
}

.avatars img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    display: block;
}

.avatars img + img {
    margin-left: -8px;
}

.social-text {
    font-size: 0.73rem;
    color: var(--text-2);
    line-height: 1.45;
}

.social-text strong {
    color: var(--text);
    font-weight: 700;
}

.social-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--gold);
    font-size: 0.72rem;
    margin-left: 4px;
    white-space: nowrap;
}

/* ===== URGENCY STRIP ===== */
.urgency-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 30px;
    background: #FFFBEB;
    border-bottom: 1px solid #FEF3C7;
    font-size: 0.7rem;
    font-weight: 500;
    color: #92400E;
}

.urgency-strip svg {
    flex-shrink: 0;
}

/* ===== FORM ===== */
.card-form {
    padding: 24px 30px 28px;
}

.form-intro {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 20px;
}

.form-intro strong {
    color: var(--text);
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-2);
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    padding: 14px 40px 14px 14px;
    font-family: var(--font);
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #FAFBFC;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(43,108,176,0.08);
    background: white;
}

.input-wrap input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(229,62,62,0.06);
    animation: shake 0.35s ease;
}

.input-wrap input.valid {
    border-color: var(--green);
    background: var(--green-bg);
}

.input-wrap input.prefilled {
    background: var(--green-bg);
    border-color: var(--green);
}

.input-wrap input::placeholder {
    color: #C4CDD5;
    font-weight: 400;
}

/* Field validation icons */
.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.input-wrap input.valid ~ .field-icon {
    opacity: 1;
}

.input-wrap input.valid ~ .field-icon::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--green);
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='9'/%3E%3Cpath d='M5.5 9.5l2 2 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='9'/%3E%3Cpath d='M5.5 9.5l2 2 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.input-wrap input.error ~ .field-icon {
    opacity: 1;
}

.input-wrap input.error ~ .field-icon::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--error);
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='9'/%3E%3Cpath d='M6 6l6 6M12 6l-6 6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='9'/%3E%3Cpath d='M6 6l6 6M12 6l-6 6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ===== CONSENT ===== */
.consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 2px 0;
}

.consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    accent-color: var(--blue-600);
    cursor: pointer;
}

.consent span {
    font-size: 0.68rem;
    color: var(--text-3);
    line-height: 1.5;
}

.consent a {
    color: var(--blue-600);
    text-decoration: none;
}

.consent.error-consent span {
    color: var(--error);
}

/* ===== BUTTON ===== */
button {
    width: 100%;
    padding: 17px 24px;
    min-height: 56px;
    background: var(--blue-600);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-top: 4px;
    box-shadow:
        0 1px 3px rgba(43,108,176,0.15),
        0 4px 14px rgba(43,108,176,0.18);
    letter-spacing: -0.01em;
}

button:hover {
    background: var(--blue-hover);
    box-shadow:
        0 1px 3px rgba(43,108,176,0.2),
        0 6px 20px rgba(43,108,176,0.22);
}

button:active {
    transform: scale(0.985);
}

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

.btn-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
}

button:hover .btn-arrow {
    transform: translateX(3px);
}

/* ===== UNDER BUTTON ===== */
.under-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-3);
    margin-top: 10px;
    font-weight: 500;
    flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.card-footer {
    padding: 18px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    color: var(--text-2);
    font-weight: 500;
}

.footer-item svg {
    flex-shrink: 0;
}

/* ===== LEGAL ===== */
.legal {
    text-align: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    margin-top: 16px;
    line-height: 1.5;
    padding: 0 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding: 12px;
    }

    .page { max-width: 100%; }

    .card-header { padding: 24px 22px 22px; }
    .social-proof { padding: 12px 22px; }
    .urgency-strip { padding: 10px 22px; }
    .card-form { padding: 20px 22px 24px; }
    .card-footer { padding: 16px 22px; }

    h1 { font-size: 1.18rem; }
    .h1-sub { font-size: 0.74rem; }

    .bg-hero::before {
        background: linear-gradient(170deg, #0D1B2E 0%, #152A46 30%, #1A365D 42%, #E8EDF3 42.1%, #F0F4F8 100%);
    }
}

@media (min-width: 481px) {
    .card {
        transition: box-shadow 0.3s;
    }
    .card:hover {
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.06),
            0 4px 6px rgba(0,0,0,0.04),
            0 24px 68px rgba(0,0,0,0.14),
            0 0 100px rgba(43,108,176,0.08);
    }
}

/* ===== EXIT POPUP ===== */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.popup {
    background: white;
    border-radius: 16px;
    padding: 36px 30px 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.active .popup {
    transform: scale(1) translateY(0);
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-3);
    cursor: pointer;
    width: 36px;
    height: 36px;
    min-height: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: none;
    margin: 0;
    letter-spacing: 0;
    font-weight: 400;
}

.popup-close:hover {
    background: #F7FAFC;
    color: var(--text);
}

.popup-emoji {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.popup-text {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 22px;
}

.popup-text strong {
    color: var(--text);
}

.popup-cta {
    width: 100%;
    padding: 16px 24px;
    min-height: 54px;
    background: var(--blue-600);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 1px 3px rgba(43,108,176,0.15),
        0 4px 14px rgba(43,108,176,0.18);
    margin: 0;
    letter-spacing: -0.01em;
}

.popup-cta:hover {
    background: var(--blue-hover);
}

.popup-sub {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 10px;
    font-weight: 500;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card { animation: none; }
    .btn-arrow { transition: none; }
    .input-wrap input { transition: none; }
    .field-icon { transition: none; }
    .popup-overlay { transition: none; }
    .popup { transition: none; }
}
