:root {
    /* fundo sempre escuro: o logótipo é branco */
    --bg: #4b5563;
    --card: #ffffff;
    --text: #111827;
    --muted: #4b5563;
    --border: #d1d5db;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --radius: 14px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card: #1e293b;
        --text: #f1f5f9;
        --muted: #94a3b8;
        --border: #334155;
        --primary: #3b82f6;
        --primary-hover: #2563eb;
        --success-bg: #14532d;
        --success-text: #bbf7d0;
        --error-bg: #7f1d1d;
        --error-text: #fecaca;
        color-scheme: dark;
    }
}

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

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.layout {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 5vw, 64px);
    padding: 24px 16px;
}

.logo {
    width: clamp(140px, 22vw, 260px);
    height: auto;
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.08);
}

h1 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 0.95rem; margin: 0 0 24px; }

form { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 600; }

input {
    width: 100%;
    font: inherit;
    font-weight: 400;
    padding: 12px;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
}
input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }

button, .survey-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s;
}
button:hover, .survey-link:hover { background: var(--primary-hover); }
button:disabled { opacity: .7; cursor: progress; }
button.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.survey-link { margin-top: 12px; background: #16a34a; }
.survey-link:hover { background: #15803d; }
.survey-link[hidden], .status[hidden] { display: none; }

.status { margin-top: 16px; padding: 12px; border-radius: 10px; font-size: 0.95rem; text-align: center; }
.status--success { background: var(--success-bg); color: var(--success-text); }
.status--error { background: var(--error-bg); color: var(--error-text); }

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

@media (max-width: 720px) {
    .layout { flex-direction: column; justify-content: flex-start; gap: 20px; }
    .card { padding: 24px 20px; }
}
@media (max-width: 380px) {
    .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    button.is-loading::before { animation: none; }
}
