/* --- CSS VARIABLES --- */
:root {
    --brand-blue: #1A73E8;
    --brand-blue-dark: #1558b0;
    --brand-bg: #f5f9ff;
    --brand-green: #059669;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-light: #94a3b8;
    --white: #ffffff;
    --error: #dc2626;
    --success: #059669;
    --transition: all 0.25s ease;
}

/* --- BASE RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- OPTIMIZED BACKGROUND --- */
.page-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: 
        radial-gradient(circle at 0% 0%, #f5f9ff 0%, transparent 40%),
        radial-gradient(circle at 100% 0%, #eef2ff 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, #f8fafc 0%, transparent 40%);
}

.blob { display: none; }

/* --- NAVIGATION --- */
nav {
    position: relative;
    z-index: 10;
    padding: 1.5rem 5%;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.logo-container img {
    height: 38px;
    width: auto;
}

/* --- HERO SECTION --- */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    position: relative;
    z-index: 5;
}

.hero-card {
    max-width: 850px;
    text-align: center;
    width: 100%;
}

/* --- BADGE WITH COLOR SHIFT --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: 
        slideDown 0.6s ease-out, 
        badgeColorShift 4s infinite ease-in-out;
    will-change: transform, opacity, background-color, border-color, color;
}

.badge i {
    margin-right: 8px;
    font-size: 7px;
    animation: dotPulse 2s infinite;
}

h1 {
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin-bottom: 1.25rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.1s forwards;
    will-change: transform, opacity;
}

.accent {
    background: linear-gradient(90deg, var(--brand-blue), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.description {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
    will-change: transform, opacity;
}

/* --- FORM STYLING --- */
.form-container {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
    will-change: transform, opacity;
}

form {
    background: var(--white);
    padding: 6px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: var(--transition);
}

form.hidden-form {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.input-group {
    position: relative;
    flex: 1;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
}

input {
    width: 100%;
    padding: 16px 18px 16px 50px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    background: #f8fafc;
    color: var(--text-main);
}

.submit-btn {
    position: relative; /* Added for absolute spinner centering */
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    min-width: 160px;
}

.submit-btn:hover:not(:disabled) {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(26, 115, 232, 0.2);
}

.submit-btn:disabled {
    cursor: not-allowed;
}

/* --- FEEDBACK AREA --- */
.feedback-area {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.status-box {
    display: none;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    animation: popIn 0.4s ease-out forwards;
}

.status-box.active { display: flex; }

.status-box.success {
    background: #ffffff;
    color: var(--success);
    border: 2px solid #a7f3d0;
}

.status-box.error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
    font-size: 0.95rem;
}

/* --- UI ELEMENTS --- */
.spinner {
    display: none;
    position: absolute; /* Force center regardless of text/gap */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin: 0;
}

footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* --- KEYFRAMES --- */
@keyframes spin { 
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

@keyframes badgeColorShift {
    0%, 100% {
        background: rgba(26, 115, 232, 0.08);
        border: 1px solid rgba(26, 115, 232, 0.2);
        color: var(--brand-blue);
    }
    50% {
        background: rgba(5, 150, 105, 0.08);
        border: 1px solid rgba(5, 150, 105, 0.2);
        color: var(--brand-green);
    }
}

/* --- RESPONSIVE --- */
@media (min-width: 640px) {
    form { flex-direction: row; }
    .submit-btn { width: auto; }
}