/* =========================================================================
   Email Validation Demo — stylesheet
   Modern, corporate, responsive. Mobile-first.
   ========================================================================= */

:root {
    --bg:            #f4f7fb;
    --surface:       #ffffff;
    --ink:           #0f1b35;
    --ink-soft:      #4a5670;
    --muted:         #8a94ad;
    --primary:       #146ef5;
    --primary-dark:  #0b56c9;
    --primary-soft:  #e7f0fe;
    --accent:        #4f9bff;
    --danger:        #dc2626;
    --danger-soft:   #fef2f2;
    --success:       #16a34a;
    --success-soft:  #ecfdf3;
    --border:        #e3e8f0;
    --ring:          rgba(37, 99, 235, .18);
    --shadow-sm:     0 1px 2px rgba(15, 27, 53, .06);
    --shadow-md:     0 10px 30px rgba(15, 27, 53, .08);
    --shadow-lg:     0 24px 60px rgba(15, 27, 53, .12);
    --radius:        16px;
    --radius-sm:     10px;
    --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 100% -10%, #e0ecff 0%, rgba(224, 236, 255, 0) 55%),
        radial-gradient(900px 500px at -10% 0%, #e6fbff 0%, rgba(230, 251, 255, 0) 50%),
        var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

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

/* ----- Header ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(160%) blur(8px);
    background: rgba(255, 255, 255, .8);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.brand-logo {
    display: block;
    height: 34px;
    width: auto;
}
.nav-link {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--primary-dark); background: var(--primary-soft); }

/* ----- Main / hero ----- */
.main { flex: 1; padding: 56px 20px 72px; }

.hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 56px;
    align-items: center;
}
.eyebrow {
    display: inline-block;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.hero-text h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -.025em;
    margin: 0 0 18px;
    font-weight: 800;
}
.hero-text h1 .accent {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lead {
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin: 0 0 26px;
    max-width: 46ch;
}
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--ink-soft);
}
.feature-list svg {
    flex: none;
    color: var(--success);
    background: var(--success-soft);
    border-radius: 999px;
    padding: 4px;
    width: 24px; height: 24px;
}

/* ----- Card / form ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}
.form-card { padding: 32px; }
.card-head { margin-bottom: 22px; }
.card-head h2 { margin: 0 0 4px; font-size: 1.4rem; letter-spacing: -.01em; }
.card-head p  { margin: 0; color: var(--muted); }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--ink);
}
.field input {
    width: 100%;
    padding: 13px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: #fbfcfe;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #b3bccf; }
.field input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--ring);
}
.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .15); }

.error-text {
    margin: 6px 0 0;
    font-size: .82rem;
    color: var(--danger);
    min-height: 0;
    display: none;
}
.field.has-error .error-text { display: block; }

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .15s, background .15s, opacity .15s;
}
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37, 99, 235, .34); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-primary[data-loading="true"] .btn-label { opacity: .8; }
.btn-secondary {
    color: var(--primary-dark);
    background: var(--primary-soft);
    width: auto;
    padding: 12px 20px;
}
.btn-secondary:hover { background: #d8e6fe; }
.btn-icon { flex: none; }

.form-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 16px 0 0;
    font-size: .8rem;
    color: var(--muted);
}
.form-note svg { flex: none; color: var(--success); }

/* ----- Alerts ----- */
.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: .9rem;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-error {
    color: #991b1b;
    background: var(--danger-soft);
    border-color: #fbd5d5;
}

/* ----- Success page ----- */
.success-wrap { display: grid; place-items: center; padding: 24px 0; }
.success-card {
    max-width: 560px;
    text-align: center;
    padding: 44px 40px;
}
.success-icon {
    width: 78px; height: 78px;
    margin: 0 auto 22px;
    display: grid; place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #34d399);
    box-shadow: 0 12px 30px rgba(22, 163, 74, .3);
}
.success-card h1 { margin: 0 0 10px; font-size: 1.8rem; letter-spacing: -.02em; }
.success-lead { font-size: 1.08rem; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.success-body { color: var(--ink-soft); margin: 0 0 28px; }
.success-cta { width: auto; display: inline-flex; padding: 14px 24px; }

/* ----- Footer ----- */
.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .6);
    padding: 22px 0;
}
.site-footer p { margin: 0; text-align: center; font-size: .85rem; color: var(--muted); }

/* ----- Responsive ----- */
@media (max-width: 880px) {
    .hero { grid-template-columns: 1fr; gap: 36px; }
    .main { padding: 36px 20px 56px; }
    .hero-text { order: 1; }
    .form-card { order: 2; }
    .lead { max-width: none; }
}
@media (max-width: 480px) {
    .card, .form-card { padding: 24px 20px; }
    .success-card { padding: 32px 22px; }
    .header-inner { height: 58px; }
    .brand-text { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
