/* ============================================================
   Sistema de Inscrição de Eleitores - Estilos
   Design responsivo (mobile-first), acessível e moderno.
   ============================================================ */

:root {
    --color-primary: #373636;
    --color-primary-dark: #4e8371;
    --color-primary-light: #2f81f7;
    --color-bg: #f2f5f9;
    --color-surface: #ffffff;
    --color-text: #1c2733;
    --color-muted: #5b6b7b;
    --color-border: #dbe2ea;
    --color-success: #1a9c5b;
    --color-success-bg: #e6f6ee;
    --color-warning: #d97706;
    --color-warning-bg: #fdf3e3;
    --color-error: #d64545;
    --color-error-bg: #fdecec;
    --color-info-bg: #e8f1fd;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(20, 40, 70, 0.08);
    --shadow-sm: 0 2px 8px rgba(20, 40, 70, 0.06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

/* ------------------------------ Topbar ------------------------------ */
.topbar {
    background: var(--color-primary);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand__logo {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
}

.brand__name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.periodo-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.periodo-chip__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.periodo-chip--aberto .periodo-chip__dot {
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.periodo-chip--antes .periodo-chip__dot {
    background: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

.periodo-chip--depois .periodo-chip__dot {
    background: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

/* ------------------------------ Main ------------------------------ */
.main {
    flex: 1;
    padding-top: 32px;
    padding-bottom: 48px;
}

/* ------------------------------ Messages ------------------------------ */
.messages {
    margin-bottom: 24px;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert p {
    margin: 0;
}

.alert--error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: #f3c1c1;
}

.alert--success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: #bfe8d2;
}

.alert--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-color: #f3dcb2;
}

.alert--info {
    background: var(--color-info-bg);
    color: var(--color-primary);
    border-color: #c9defb;
}

/* ------------------------------ Botões ------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(30, 78, 140, 0.25);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
}

.btn--primary:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 2px;
}

.btn--primary:disabled {
    background: #9db4d1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.85;
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-info-bg);
    border-color: var(--color-primary-light);
}

.btn--lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

/* ------------------------------ Hero (home) ------------------------------ */
.hero {
    display: grid;
    gap: 28px;
    margin-bottom: 40px;
}

.hero__eyebrow {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--color-info-bg);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
}

.hero__title {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    line-height: 1.15;
    color: var(--color-primary);
    margin: 0 0 16px;
    text-align: center;
    margin-top: 20px;
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--color-muted);
    max-width: 100%;
    margin: 0 0 24px;
    text-align: center;
}

.hero__actions {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.hero__periodo {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0;
    text-align: center;
}

.hero__periodo strong {
    color: var(--color-primary);
}

.status-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.status-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 800;
}

.status-card--open .status-card__icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.status-card--wait .status-card__icon {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.status-card--closed .status-card__icon {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.status-card__title {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--color-text);
}

.status-card__text {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ------------------------------ Features ------------------------------ */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.feature {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.feature__icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.feature__title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--color-primary-dark);
}

.feature__text {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ------------------------------ Cabeçalho de página ------------------------------ */
.page-head {
    margin-bottom: 24px;
}

.page-head__title {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    color: var(--color-primary-dark);
}

.page-head__subtitle {
    margin: 0;
    color: var(--color-muted);
}

/* ------------------------------ Card ------------------------------ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* Cartão de cadastro localizado (etapa 2 da inscrição) */
.card--match {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border: 1.5px solid #bfe8d2;
    background: var(--color-success-bg);
    box-shadow: var(--shadow-sm);
}

.card--match__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-success);
    color: #fff;
    font-weight: 800;
}

.card--match__label {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-success);
}

.card--match__name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.card--match__cpf {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* ------------------------------ Termo de consentimento ------------------------------ */
.consent__scroll {
    max-height: 340px;
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    margin-bottom: 20px;
}

.consent__scroll h2,
.consent__scroll h3 {
    color: var(--color-primary-dark);
}

.consent__scroll h2 {
    margin-top: 0;
}

.consent__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.consent__checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    accent-color: var(--color-primary);
}

.consent__checkbox label {
    font-weight: 500;
}

.consent__actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ------------------------------ Formulário ------------------------------ */
.form {
    padding: 28px;
}

.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.form-section__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.form-section__step {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.form-section__title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--color-primary-dark);
}

.form-section__desc {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

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

.form-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text);
}

.required-asterisk {
    color: var(--color-error);
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--color-text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

select.form-input {
    cursor: pointer;
    appearance: auto;
}

.form-input::placeholder {
    color: #9aa7b5;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.15);
}

.form-field--error .form-input {
    border-color: var(--color-error);
}

.form-field--error .form-input:focus {
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}

.form-help {
    margin: 0;
    font-size: 0.82rem;
    color: var(--color-muted);
}

.form-errors {
    margin: 0;
    padding: 0;
    list-style: none;
}

.form-errors li {
    font-size: 0.85rem;
    color: var(--color-error);
    font-weight: 500;
}

/* Radio cards (função) */
.radio-group > div {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.radio-group > div > div {
    margin: 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.radio-group label:hover {
    border-color: var(--color-primary-light);
    background: var(--color-info-bg);
}

.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.radio-group > div > div:has(input[type="radio"]:checked) label {
    border-color: var(--color-primary);
    background: var(--color-info-bg);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.12);
}

.radio-group > div > div:has(input[type="radio"]:focus-visible) label {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 1px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.form-privacy {
    margin: 18px 0 0;
    font-size: 0.85rem;
    color: var(--color-muted);
    text-align: center;
}

/* ------------------------------ Sucesso ------------------------------ */
.success {
    margin: 40px auto;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 28px;
}

.success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-success-bg);
    color: var(--color-success);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.success__title {
    margin: 0 0 10px;
    color: var(--color-primary-dark);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.success__text {
    margin: 0 0 24px;
    color: var(--color-muted);
}

/* ------------------------------ Footer ------------------------------ */
.footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 20px 0;
    font-size: 0.85rem;
}

.footer p {
    margin: 0;
    text-align: center;
}

.footer a {
    color: rgba(255, 255, 255, 0.85);
}

/* ------------------------------ Responsividade ------------------------------ */
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-field--full,
    .form-field:has(.radio-group) {
        grid-column: 1 / -1;
    }

    .radio-group ul {
        grid-template-columns: repeat(2, 1fr);
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .hero {
        align-items: center;
    }

    .hero__status {
        justify-self: end;
    }
}

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