/* ============================================================
   VESTIBULAR — processo seletivo público (inscrição, entrada da
   prova, prova, obrigado). Porte visual de plataforma/css/vestibular.css
   sobre os tokens do projeto (dark + light), mobile first.
   A cor do vestibular chega em --vest-cor / --vest-cor-escura /
   --vest-cor-clara (templates/pages/vestibular/_cor.twig); sem ela,
   cai na --primary do projeto.
   ============================================================ */
.vest-body { --vest-cor: var(--primary); --vest-cor-escura: var(--primary-700); --vest-cor-clara: var(--primary-300); }
.vest-body .standalone__main { display: flex; flex-direction: column; }
.vest-body.standalone-page { overflow-x: hidden; }

/* — Estado vazio (sem vestibular aberto) — */
.vest-indisponivel { margin: auto 0; }

/* ============================================================
   INSCRIÇÃO — layout split (painel colorido + formulário)
   ============================================================ */
.vest-split { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; width: 100%; }

/* Painel esquerdo: identidade do vestibular (sempre colorido, texto branco nos dois temas) */
.vest-hero {
    position: relative; overflow: hidden; color: #fff;
    background: var(--vest-cor); background-image: linear-gradient(160deg, var(--vest-cor) 0%, var(--vest-cor-escura) 100%);
    padding: clamp(2rem, 6vw, 3.25rem) var(--sp-4) clamp(1.75rem, 5vw, 2.75rem);
    display: flex; flex-direction: column; justify-content: center;
}
.vest-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(-55deg, rgba(255, 255, 255, .06) 0, rgba(255, 255, 255, .06) 120px, transparent 120px); pointer-events: none; }
.vest-hero::after { content: ''; position: absolute; right: 0; bottom: 0; width: 220px; height: 220px; background: rgba(255, 255, 255, .05); clip-path: polygon(100% 0, 100% 100%, 0 100%); pointer-events: none; }
.vest-hero__deco { position: absolute; top: -80px; left: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .035); pointer-events: none; }
.vest-hero__content { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.vest-hero__logo { display: block; max-width: 200px; max-height: 64px; width: auto; object-fit: contain; object-position: left center; margin-bottom: 1.5rem; }
.vest-hero__brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 1.5rem; color: #fff; }
.vest-hero__mark { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1rem; }
.vest-hero__badge { display: inline-flex; align-self: flex-start; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .9); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: .32rem .8rem; border-radius: var(--r-full); margin-bottom: 1rem; }
.vest-hero__badge i { font-size: .62rem; color: rgba(255, 255, 255, .7); }
.vest-hero__title { font-size: clamp(1.4rem, 2.2vw + .6rem, 2rem); font-weight: 800; color: #fff; line-height: 1.22; letter-spacing: -.02em; margin-bottom: 1rem; overflow-wrap: anywhere; }
.vest-hero__desc { font-size: .9rem; color: rgba(255, 255, 255, .74); line-height: 1.72; overflow-wrap: anywhere; }
/* Normaliza o HTML do editor do admin */
.vest-hero__desc p, .vest-hero__desc h1, .vest-hero__desc h2, .vest-hero__desc h3, .vest-hero__desc span, .vest-hero__desc li { margin: 0 0 .6em; color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; white-space: normal; }
.vest-hero__desc ul, .vest-hero__desc ol { padding-left: 1.2em; list-style: revert; margin-bottom: .6em; }
.vest-hero__desc a { color: #fff; text-decoration: underline; }
.vest-hero__desc strong { font-weight: 700; color: #fff; }
.vest-hero__desc > :last-child { margin-bottom: 0; }
.vest-hero__features { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.6rem; }
.vest-hero__features li { display: inline-flex; align-items: center; gap: .4rem; color: rgba(255, 255, 255, .72); font-size: .75rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-full); padding: .3rem .75rem .3rem .6rem; white-space: nowrap; }
.vest-hero__features li i { font-size: .62rem; color: rgba(255, 255, 255, .85); }

/* Painel direito: formulário */
.vest-panel { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.25rem var(--sp-4) 2.5rem; background: var(--bg); }
.vest-panel__top { position: absolute; top: .9rem; right: var(--sp-4); display: inline-flex; align-items: center; gap: .75rem; }
.vest-panel__link { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.vest-panel__link:hover { color: var(--primary-text); }
.vest-form { width: 100%; max-width: 560px; margin-top: 1.25rem; }
.vest-form__head { margin-bottom: 1.75rem; }
.vest-form__title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; }
.vest-form__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.vest-form__body .field-group__label { margin-top: var(--sp-6); }
.vest-form__body .field-group__label:first-child { margin-top: 0; }
.vest-form__actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.vest-form__actions .btn { min-width: 200px; }
.vest-form__legal { display: flex; gap: .45rem; align-items: flex-start; font-size: var(--fs-xs); color: var(--text-soft); margin-top: 1rem; line-height: 1.5; }
.vest-form__legal i { margin-top: .2rem; }

/* Telefone com DDI */
.vest-phone { display: flex; gap: .5rem; align-items: stretch; }
.vest-phone .input-wrap { flex: 1; min-width: 0; }
.vest-ddi { position: relative; flex: 0 0 84px; }
.vest-ddi__prefix { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-weight: 600; pointer-events: none; }
.vest-ddi__input { padding-left: 1.6rem; padding-right: .5rem; font-weight: 600; letter-spacing: .04em; }

/* Select com ícone e seta */
.vest-select { position: relative; }
.vest-select .input { appearance: none; -webkit-appearance: none; padding-left: 2.75rem; padding-right: 2.5rem; cursor: pointer; }
.vest-select .input:disabled { opacity: .55; cursor: not-allowed; }
.vest-select__icon, .vest-select__arrow { position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-soft); pointer-events: none; font-size: var(--fs-sm); transition: color var(--dur-fast); }
.vest-select__icon { left: 1rem; }
.vest-select__arrow { right: 1rem; font-size: var(--fs-xs); }
.vest-select:focus-within .vest-select__icon { color: var(--primary-text); }
.vest-select .input option { color: var(--text); background: var(--surface); }

/* ============================================================
   CARTÕES CENTRAIS (entrada da prova, obrigado, prova enviada)
   ============================================================ */
.vest-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: .5rem 0; }
.vest-card {
    width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-2xl); box-shadow: var(--shadow-xl); padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.75rem);
    animation: fadeUp .45s var(--ease-out);
}
.vest-card--sm { max-width: 480px; }
.vest-card--center { text-align: center; }
.vest-card__title { font-size: clamp(1.35rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin-bottom: .6rem; }
.vest-card__sub { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.65; margin-bottom: 1.5rem; }
.vest-card__chip { margin: -.5rem 0 1.5rem; }
.vest-card__alert { text-align: left; }
.vest-card--center .vest-card__alert { margin-top: 1.5rem; }
.vest-card__cta { margin-top: .5rem; }
.vest-card__form { text-align: left; }
.vest-card__form .btn { margin-top: .25rem; }
.vest-card__foot { margin-top: 1.25rem; font-size: var(--fs-xs); color: var(--text-soft); }
.vest-card__foot a { font-weight: 600; }

/* Ícone redondo */
.vest-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 1.5rem; }
.vest-icon--success { background: rgba(var(--success-rgb), .14); color: var(--success); border: 2px solid rgba(var(--success-rgb), .3); box-shadow: 0 0 0 10px rgba(var(--success-rgb), .05); }
.vest-icon--search { background: rgba(var(--danger-rgb), .12); color: var(--danger); border: 2px solid rgba(var(--danger-rgb), .28); }
.vest-icon--primary { background: var(--primary-soft); color: var(--primary-text); border: 2px solid rgba(var(--primary-rgb), .3); }

/* Barra decorativa de progresso (50% entrada, 75% prova) */
.vest-progress { margin-bottom: 1.5rem; }
.vest-progress--50 .progress__fill { width: 50%; }
.vest-progress--75 .progress__fill { width: 75%; }
.vest-notice { text-align: left; }

/* Passos */
.vest-steps { text-align: left; display: flex; flex-direction: column; gap: 1rem; margin: 0; counter-reset: none; }
.vest-step { display: flex; gap: .9rem; align-items: flex-start; }
.vest-step__num { width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-primary); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; margin-top: .1rem; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .3); }
.vest-step__text { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.55; }
.vest-step__text strong { display: block; color: var(--text); font-weight: 600; margin-bottom: .15rem; }

/* ============================================================
   PROVA (/prova/responder)
   ============================================================ */
.vest-prova { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; width: 100%; }
.vest-prova__head {
    position: sticky; top: 0; z-index: 30; min-height: 68px; padding: .6rem var(--sp-4); color: #fff;
    background: var(--vest-cor); background-image: linear-gradient(135deg, var(--vest-cor) 0%, var(--vest-cor-escura) 100%);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; box-shadow: var(--shadow-md);
}
.vest-prova__brand { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.vest-prova__logo { max-height: 36px; max-width: 140px; object-fit: contain; }
.vest-prova__brand-text { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.vest-prova__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .3); flex: 0 0 auto; }
.vest-prova__vest { font-size: var(--fs-xs); font-weight: 600; color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Countdown */
.vest-countdown { display: flex; align-items: center; gap: .25rem; position: relative; flex-shrink: 0; }
.vest-countdown__block { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.vest-countdown__value { display: block; background: rgba(255, 255, 255, .15); border-radius: var(--r-sm); font-size: 1.15rem; font-weight: 800; line-height: 1; padding: .35rem .5rem; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: #fff; transition: background var(--dur), color var(--dur); }
.vest-countdown__label { font-size: .58rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .68); margin-top: .25rem; }
.vest-countdown__sep { font-size: 1.15rem; font-weight: 800; color: rgba(255, 255, 255, .4); align-self: flex-start; padding-top: .3rem; }
.vest-countdown.is-urgent .vest-countdown__value { background: rgba(239, 68, 68, .35); color: #fecaca; animation: vestPulse 1s ease-in-out infinite; }
.vest-countdown__over { position: absolute; top: calc(100% + .2rem); right: 0; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fecaca; white-space: nowrap; display: inline-flex; gap: .3rem; align-items: center; }
.vest-countdown.is-over .vest-countdown__value { animation: none; }
@keyframes vestPulse { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }

/* Corpo da prova */
.vest-prova__body { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 1.5rem var(--sp-4) 2rem; display: flex; flex-direction: column; align-items: stretch; }
.vest-card--prova { max-width: none; animation: none; }
.vest-candidato { display: flex; flex-direction: column; gap: .25rem; padding: .9rem 1.1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 1.5rem; }
.vest-candidato__nome { font-weight: 700; font-size: var(--fs-md); color: var(--text); }
.vest-candidato__curso, .vest-candidato__prazo { font-size: var(--fs-xs); color: var(--text-muted); display: inline-flex; gap: .35rem; align-items: center; }
.vest-candidato__prazo { color: var(--text-soft); }
.vest-instrucao { background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: 0 var(--r-lg) var(--r-lg) 0; padding: .9rem 1.1rem; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.7; margin-bottom: 1.25rem; }
.vest-instrucao strong { color: var(--text); }
.vest-pergunta { font-size: var(--fs-lg); font-weight: 600; color: var(--text); line-height: 1.6; margin-bottom: 1.5rem; padding: 1.1rem 1.25rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-lg); overflow: hidden; overflow-wrap: anywhere; }
/* Normaliza o HTML do editor no enunciado */
.vest-pergunta p { margin: 0 0 .75rem; }
.vest-pergunta p:last-child { margin-bottom: 0; }
.vest-pergunta ul, .vest-pergunta ol { margin: 0 0 .75rem; padding-left: 1.3rem; list-style: revert; }
.vest-pergunta li { margin-bottom: .25rem; }
.vest-pergunta h1, .vest-pergunta h2, .vest-pergunta h3 { font-size: var(--fs-md); margin: 0 0 .5rem; }
.vest-pergunta strong { font-weight: 700; }
.vest-pergunta em { font-style: italic; }
.vest-pergunta a { text-decoration: underline; }
.vest-pergunta img, .vest-pergunta table, .vest-pergunta iframe { max-width: 100%; height: auto; }

/* Redação */
.vest-textarea { min-height: 260px; line-height: 1.7; resize: vertical; padding: 1rem; font-size: var(--fs-base); }
.vest-counter { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .55rem; font-size: var(--fs-xs); color: var(--text-muted); }
.vest-counter__words { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.vest-counter__words strong { color: var(--text); font-weight: 700; }
.vest-counter.is-over .vest-counter__words { color: var(--danger); }
.vest-counter.is-over .vest-counter__words strong { color: var(--danger); }
.vest-counter__draft { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-soft); }
.vest-counter__draft i { color: var(--success); }

.vest-foot { padding: 1rem var(--sp-4); text-align: center; font-size: var(--fs-xs); color: var(--text-soft); border-top: 1px solid var(--border); margin-top: auto; }

/* ============================================================
   MODAIS (base .modal do projeto)
   ============================================================ */
.vest-modal__box { max-width: 440px; }
.vest-modal__body { text-align: center; padding: var(--sp-8) var(--sp-6) var(--sp-6); }
.vest-modal__body .vest-icon { width: 60px; height: 60px; font-size: 1.4rem; margin-bottom: 1.1rem; }
.vest-modal__title { font-size: var(--fs-xl); font-weight: 700; margin-bottom: .5rem; }
.vest-modal__text { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.vest-modal__actions { display: flex; flex-direction: column; gap: .6rem; }
.vest-modal__actions--row { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.vest-modal__actions--row .btn { flex: 1 1 140px; }

/* ============================================================
   TEMA LIGHT — ajustes pontuais
   ============================================================ */
[data-theme="light"] .vest-card { box-shadow: var(--shadow-lg); }
[data-theme="light"] .vest-pergunta, [data-theme="light"] .vest-candidato { background: var(--bg-elev); }
[data-theme="light"] .vest-countdown__value { background: rgba(255, 255, 255, .18); }
[data-theme="light"] .vest-countdown.is-urgent .vest-countdown__value { background: rgba(239, 68, 68, .45); color: #fff; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (min-width: 901px) {
    .vest-split { flex-direction: row; }
    .vest-hero { width: 42%; flex: 0 0 42%; min-height: 100vh; min-height: 100dvh; padding: 4rem 3.25rem; }
    .vest-hero__logo { max-width: 260px; max-height: 80px; margin-bottom: 2.25rem; }
    .vest-panel { min-height: 100vh; min-height: 100dvh; padding: 4rem 3rem; overflow-y: auto; }
    .vest-panel__top { top: 1.1rem; right: 1.5rem; }
    .vest-form { margin-top: 0; }
    .vest-prova__head { padding: .6rem clamp(1rem, 3vw, 2rem); }
    .vest-countdown__block { min-width: 52px; }
    .vest-countdown__value { font-size: 1.4rem; min-width: 52px; padding: .4rem .6rem; }
    .vest-countdown__sep { font-size: 1.4rem; }
    .vest-prova__body { padding: 2.5rem var(--sp-6) 3rem; }
}
@media (min-width: 901px) and (max-width: 1024px) {
    .vest-hero { width: 46%; flex-basis: 46%; padding: 3.25rem 2.5rem; }
}
@media (max-width: 900px) {
    .vest-hero__features { display: none; }
    /* Formulário logo abaixo do hero (sem centralizar no espaço restante) e barra do tema estática */
    .vest-panel { justify-content: flex-start; padding-top: 1rem; }
    .vest-panel__top { position: static; width: 100%; max-width: 560px; justify-content: flex-end; margin: 0 auto .25rem; }
    .vest-form { margin-top: .75rem; }
}
@media (max-width: 600px) {
    .vest-form__actions { justify-content: stretch; }
    .vest-form__actions .btn { width: 100%; }
    .vest-prova__vest { display: none; }
    .vest-prova__sep { display: none; }
    .vest-countdown__block { min-width: 40px; }
    .vest-countdown__value { font-size: 1rem; min-width: 40px; padding: .3rem .4rem; }
    .vest-countdown__label { font-size: .52rem; }
    .vest-counter { justify-content: flex-end; }
    .vest-counter__draft { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   IMPRESSÃO
   ============================================================ */
@media print {
    .vest-hero, .vest-panel__top, .vest-prova__head, .vest-progress, .vest-form__actions, .vest-counter__draft, .vest-modal, .vest-foot { display: none !important; }
    .vest-card { box-shadow: none; border-color: #ccc; }
    .vest-textarea { min-height: auto; }
}
