:root {
    --tc-blue: #1b3c7c;
    --tc-blue-dark: #132a56;
    --tc-blue-soft: rgba(27, 60, 124, 0.12);
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #dbe4f0;
    --radius-lg: 16px;
    --radius-md: 10px;
}

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

html, body {
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(ellipse 120% 75% at 50% -25%, rgba(67, 112, 196, 0.35), transparent 55%),
        linear-gradient(160deg, var(--tc-blue-dark) 0%, var(--tc-blue) 52%, #0f1f37 100%);
    color: #fff;
    padding: 20px 14px 28px;
    line-height: 1.45;
}

.logo {
    display: block;
    margin: 2px auto 14px;
    max-width: min(70vw, 230px);
    width: auto;
    height: auto;
}

h1 {
    text-align: center;
    margin-bottom: 14px;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

form {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    color: var(--text);
    padding: 18px 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 22px 45px rgba(10, 20, 40, 0.24);
}

label {
    display: block;
    margin-top: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.field-nascimento-idade {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(108px, 34%);
    gap: 12px 16px;
    align-items: start;
}

.field-nascimento-bloco,
.field-idade-bloco {
    min-width: 0;
}

.field-nascimento-inputs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.dn-part {
    width: auto;
    min-width: 0;
    min-height: 0;
    flex: 0 0 3.1rem;
    margin-top: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.dn-part.dn-ano {
    flex: 0 0 4.6rem;
}

.dn-sep {
    font-weight: 700;
    color: var(--text-muted);
    user-select: none;
    flex-shrink: 0;
}

.idade-caixa {
    margin-top: 0;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #f1f5f9;
    font-size: 0.97rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--tc-blue-dark);
    text-align: center;
}

@media (max-width: 520px) {
    .field-nascimento-idade {
        grid-template-columns: 1fr;
    }
}

input,
select,
textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    color: var(--text);
    font-size: 0.97rem;
    line-height: 1.35;
    padding: 11px 12px;
    min-height: 2.65rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Mesma “altura” e estética dos inputs; browsers nativos deixam o select mais baixo. */
select {
    -webkit-appearance: none;
    appearance: none;
    padding-top: 11px;
    padding-bottom: 11px;
    padding-left: 12px;
    padding-right: 2.35rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5L7 7l6-5.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 9px;
    cursor: pointer;
}

select::-ms-expand {
    display: none;
}

input[type="radio"],
input[type="checkbox"] {
    min-height: 0;
    width: auto;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #c3d1e3;
    background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--tc-blue);
    box-shadow: 0 0 0 3px var(--tc-blue-soft);
    background-color: #fff;
}

textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.45;
}

input[type="file"] {
    min-height: 0;
    padding: 9px 10px;
    background-color: #fff;
}

.radio-group {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.radio-group label {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

.radio-group input[type="radio"] {
    margin-top: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--tc-blue);
}

button {
    width: 100%;
    margin-top: 18px;
    padding: 13px 16px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(180deg, #2d5aa8 0%, var(--tc-blue) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 8px 20px rgba(27, 60, 124, 0.3);
}

button:hover {
    filter: brightness(1.05);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.88;
    filter: grayscale(0.08);
    transform: none;
    box-shadow: 0 4px 14px rgba(27, 60, 124, 0.22);
}

.form-candidatura--enviando {
    pointer-events: none;
    user-select: none;
}

.form-enviando-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.form-enviando-overlay[hidden] {
    display: none !important;
}

.form-enviando-card {
    max-width: 360px;
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 26px 22px 24px;
    text-align: center;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
}

.form-enviando-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--tc-blue);
    border-radius: 50%;
    animation: form-enviando-spin 0.75s linear infinite;
}

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

.form-enviando-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.form-enviando-sub {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

@media (min-width: 600px) {
    body {
        padding: 26px 22px 32px;
    }

    h1 {
        font-size: 1.7rem;
        margin-bottom: 18px;
    }

    form {
        padding: 24px 24px 22px;
    }

    label {
        font-size: 0.9rem;
    }
}
