/* DVT Challenges – Photo submission block (dvt_challenge_participate).
 * Two-column layout: editable fields + consents on the left, drop zone on the
 * right. Mirrors the campaign landing-page design. All colours are tokenised so
 * a theme can override them via :root without touching this file. */
.dvt-participate {
    --dvt-green: #8cc63f;
    --dvt-teal: #0f3d3e;
    --dvt-muted: #5a6b57;
    --dvt-pink: #e85d6a;
    --dvt-pink-soft: #fdeef0;
    --dvt-radius: 22px;
    --dvt-line: #DCDFE4;
    /* Paleta do formulario, alinhada com o Figma da campanha: texto preto,
     * ligacoes no verde de marca (o mesmo do botao Participar) e os apoios
     * -- "(Obrigatorio)", nota do maximo -- no cinza-azulado da borda dos
     * campos. Os tokens antigos (--dvt-teal, --dvt-pink, --dvt-muted) ficam:
     * ainda servem o modal de sucesso e as mensagens de erro, que este
     * desenho nao cobre. */
    --dvt-ink: #000;
    --dvt-accent: #008851;
    --dvt-note: #64718B;
    --dvt-dash: #C7CCD4;
    --dvt-surface: #F6F7F9;
    color: var(--dvt-ink);
}

/* (0,2,0): passa a ganhar ao .entry-content h2 do tema, que impunha 40px --
 * grande demais para o titulo desta seccao. */
.dvt-participate .dvt-participate__heading {
    font-size: clamp(20px, 3vw, 28px);
    letter-spacing: -0.5px;
    color: var(--dvt-ink);
    margin: 0 0 12px;
}

.dvt-participate .dvt-participate__intro {
    color: var(--dvt-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
    max-width: 52ch;
    margin: 0 0 24px;
}

/* ── Two-column grid ─────────────────────────────────────────────────────── */
/* Especificidade (0,2,0) de proposito: o dvt-ranking.css poe
 * .dvt-participate__form { display:flex } no MESMO elemento com (0,1,0) e,
 * carregando depois, ganhava — o grid ficava inerte, as colunas encolhiam ao
 * conteudo e sobravam ~155px por preencher a direita.
 *
 * Proporcao 1 : 1.12 — o cartao da direita e sempre maior que a coluna dos
 * campos, como no desenho. Da exatamente 515px / 577px a 1440, que e a largura
 * que a coluna esquerda ja tinha. Em fracoes e nao em px fixos de proposito:
 * com 515px fixos a direita passava a ser a MAIS ESTREITA a partir dos ~1100,
 * porque so a coluna flexivel encolhia. O minmax(0, ...) evita que o conteudo
 * impeca as colunas de encolher. */
.dvt-participate__form.dvt-participate__grid,
.dvt-participate__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 40px;
    align-items: stretch;
}

/* O cartao ocupa a altura toda da coluna e centra o conteudo nos dois eixos. */
.dvt-participate__col--drop {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.dvt-participate__dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dvt-participate__col--fields { min-width: 0; }

/* ── Phone text field ────────────────────────────────────────────────────── */
.dvt-participate__field { margin-bottom: 40px; }

.dvt-participate .dvt-participate__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dvt-ink);
}

.dvt-participate__input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #64718B;
    border-radius: 40px;
    font-size: 14px;
    box-sizing: border-box;
}

.dvt-participate__input:focus {
    outline: none;
    border-color: var(--dvt-green);
    box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.18);
}

/* ── Consent checkboxes ──────────────────────────────────────────────────── */
.dvt-participate__consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--dvt-ink);
    margin-bottom: 28px;
    cursor: pointer;
    line-height: 1.5;
}

.dvt-participate__consent input {
    margin-top: 2px;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    accent-color: var(--dvt-accent);
}

.dvt-participate__consent a {
    color: var(--dvt-accent);
    font-weight: 700;
}

/* Em linha propria, como no desenho -- inline ficava agarrado ao fim da
 * frase e disputava a atencao com as ligacoes. */
.dvt-participate__req-tag {
    display: block;
    margin-top: 2px;
    color: var(--dvt-note);
    font-style: normal;
    font-weight: 700;
}

/* Excecao: na etiqueta do telemovel fica ao lado do nome do campo, nao por
 * baixo. */
.dvt-participate .dvt-participate__label .dvt-participate__req-tag {
    display: inline;
    margin-top: 0;
    font-weight: 600;
}

/* ── Actions / submit ────────────────────────────────────────────────────── */
.dvt-participate__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.dvt-participate__submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
    padding: 13px 28px;
    border-radius: 30px;
    letter-spacing: 0.3px;
    transition: background 0.15s, opacity 0.15s;
}

/* Active state — brand green. Scoped selector (0,2,0) already beats the theme's
   single-class .dvt-challange-button, so no !important is needed — which lets the
   per-block colour override (scoped inline <style>) win cleanly. */
.dvt-participate .dvt-participate__submit-btn {
    background: #008851;
    color: #fff;
}

.dvt-participate .dvt-participate__submit-btn:hover:not(:disabled):not(.is-disabled) {
    background: #00733f;
}

/* Disabled state (required fields empty / no photo). Covers the native
   :disabled/[disabled] and the JS-toggled .is-disabled fallback class. */
.dvt-participate .dvt-participate__submit-btn:disabled,
.dvt-participate .dvt-participate__submit-btn[disabled],
.dvt-participate .dvt-participate__submit-btn.is-disabled {
    background: #BAC0CC !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

.dvt-participate__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 61, 62, 0.2);
    border-top-color: var(--dvt-teal);
    border-radius: 50%;
    animation: dvt-spin 0.7s linear infinite;
}

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

/* ── Drop zone (right column) ────────────────────────────────────────────── */
/* Duas camadas, como no desenho: o cartao exterior (fundo neutro, cantos
   redondos) e, la dentro, a area tracejada que sinaliza "larga aqui". O
   tracejado e feito com ::before em vez de um elemento novo -- e decoracao,
   nao precisa de existir no DOM.
   O tracejado e cinzento e nao vermelho de proposito: a caixa e informativa,
   nao um estado de erro, e o vermelho lia-se como validacao falhada mesmo
   antes de o utilizador tocar no campo. */
.dvt-participate__dropzone {
    position: relative;
    border: 1px solid var(--dvt-line);
    background: var(--dvt-surface);
    border-radius: var(--dvt-radius);
    padding: 40px 28px;
    text-align: center;
}

.dvt-participate__dropzone::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed var(--dvt-dash);
    border-radius: 16px;
    background: #fff;
    pointer-events: none;
}

/* O conteudo sobe acima do tracejado, senao o ::before ficava por cima. */
.dvt-participate__dropzone > * {
    position: relative;
}

.dvt-participate__dz-icon {
    display: block;
    margin: 0 auto 8px;
    color: var(--dvt-ink);
}

/* (0,2,0) obrigatorio nestes dois: o tema estiliza .entry-content h4 (24px) e
   .entry-content p (16px, 20px acima de certo breakpoint) com (0,1,1) e
   ganhava as classes sozinhas -- era por isso que "Formatos permitidos" saia
   do tamanho de um paragrafo de conteudo. */
.dvt-participate .dvt-participate__dz-title {
    font-family: var(--font-campanha);
    color: var(--dvt-ink);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.dvt-participate .dvt-participate__dz-formats {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--dvt-ink);
    margin: 0 0 18px;
}

.dvt-participate__dz-button {
    font-family: var(--font-campanha);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #000;
    border: 2px solid #000;
    color: #fff;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 13px;
    padding: 11px 22px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.15s;
}

.dvt-participate__dz-button:hover { background: #fff; color: #000; }

/* Kept invisible but out of the click path (pointer-events: none) — JS opens
   it via input.click() on click/drag-drop (see dvt-participate.js). Relying
   on this transparent-overlay-catches-the-click trick on its own is what
   silently didn't open any dialog in some real Chrome/Safari installs
   (extensions and stricter "deceptive overlay" heuristics can target exactly
   this pattern); it stays focusable so the browser can still anchor the
   native "required" validation bubble to it. */
.dvt-participate__dz-button input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.dvt-participate__dropzone.is-dragover {
    border-color: var(--dvt-ink);
    background: #f7f7f7;
}

/* Vive fora do cartao (ver o markup em class-dvt-shortcodes.php): e uma nota
   sobre o que se pode enviar, nao conteudo da area de largar. */
.dvt-participate__dz-required {
    display: block;
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-align: left;
    color: var(--dvt-note);
}

.dvt-participate__image-preview {
    margin-top: 16px;
}

.dvt-participate__image-preview img {
    max-width: 100%;
    max-height: 160px;
    border-radius: 12px;
    display: block;
    margin: 0 auto 8px;
    object-fit: cover;
}

.dvt-participate__remove-image {
    background: transparent;
    border: none;
    color: var(--dvt-pink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* ── Upload feedback (redesigned dropzone) ───────────────────────────────────
 * Lives BELOW the dashed card (see the markup in class-dvt-shortcodes.php),
 * not inside it -- it's feedback about the upload, not part of the "drop a
 * file here" invitation. Adapts the same progress-bar pattern already used
 * for password strength on the reset-password screen (track + rounded fill,
 * width set from JS): thin rounded track, coloured fill, percentage below. */
.dvt-participate__upload {
    text-align: left;
}

.dvt-participate__upload-divider {
    border: none;
    border-top: 1px solid var(--dvt-line);
    margin: 0 0 16px;
}

.dvt-participate__upload-file {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dvt-participate__upload-file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dvt-participate__upload-filename {
    font-size: 13px;
    font-weight: 700;
    color: var(--dvt-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dvt-participate__upload-filesize {
    font-size: 11px;
    font-weight: 600;
    color: var(--dvt-note);
}

.dvt-participate__upload-file-actions {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.dvt-participate__upload-file-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--dvt-ink);
    cursor: pointer;
}

.dvt-participate__upload-file-actions button:hover {
    background: var(--dvt-surface);
}

.dvt-participate__upload-remove:hover {
    color: var(--dvt-pink);
}

.dvt-participate__upload-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Own class (not .dvt-participate__spinner) on purpose: that one is toggled
 * by setLoading() for the submit button and $form.find() would catch both,
 * showing/hiding this one as a side effect of an unrelated action. */
.dvt-participate__upload-spinner {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 136, 81, 0.2);
    border-top-color: var(--dvt-accent);
    border-radius: 50%;
    animation: dvt-spin 0.7s linear infinite;
}

.dvt-participate__upload-message {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--dvt-accent);
}

.dvt-participate__upload-track {
    height: 8px;
    width: 100%;
    border-radius: 999px;
    background: var(--dvt-line);
    overflow: hidden;
    margin-bottom: 6px;
}

.dvt-participate__upload-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--dvt-accent);
    transition: width 0.15s linear;
}

.dvt-participate__upload-percent {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--dvt-note);
}

/* ── Availability notice (cooldown / daily limit / max submissions) ───────
 * Shown at page load when the user can't participate right now, and updated by
 * the countdown in dvt-participate.js. (0,2,1): beats the theme's small grey
 * .entry-content .dvt-participate__closed, which is too quiet for this. */
.dvt-participate p.dvt-participate__notice {
    background: #fff7e0;
    border: 1px solid #f0d48a;
    color: #6b4e00;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 0 0 16px;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
}

/* Locked form: the drop zone reads as unavailable, not just inert. */
.dvt-participate__form:has(input[type="file"]:disabled) .dvt-participate__dropzone {
    opacity: 0.5;
    cursor: not-allowed;
}
.dvt-participate__form:has(input[type="file"]:disabled) .dvt-participate__dz-button {
    cursor: not-allowed;
}

/* ── Feedback ────────────────────────────────────────────────────────────── */
.dvt-participate__error {
    background: var(--dvt-pink-soft);
    color: #b23b47;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

.dvt-participate__success {
    background: #eaf5d8;
    color: #3e6b2e;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 14px;
}

/* ── Success popup / modal ───────────────────────────────────────────────── */
.dvt-participate__modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dvt-participate__modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 25, 0.55);
}

.dvt-participate__modal-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.dvt-participate__modal-points {
    display: inline-block;
    background: #eaf5d8;
    color: #008851;
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
    padding: 18px 22px;
    border-radius: 18px;
    margin-bottom: 18px;
}
.dvt-participate__modal-points small { font-size: 12px; display: block; font-weight: 700; }

.dvt-participate__modal-title {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    color: var(--dvt-teal);
    margin: 0 0 14px;
    text-transform: uppercase;
}

.dvt-participate__modal-text {
    color: var(--dvt-muted);
    font-size: 13.5px;
    margin-bottom: 24px;
}
.dvt-participate__modal-text p { margin: 0 0 10px; }

.dvt-participate__modal-more {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    background: #008851 !important;
    color: #fff !important;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 15px 20px;
    border-radius: 32px;
    margin-bottom: 12px;
}
.dvt-participate__modal-more:hover { background: #00733f !important; }

.dvt-participate__modal-account {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #fff;
    color: var(--dvt-teal);
    border: 2px solid var(--dvt-teal);
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 13px 20px;
    border-radius: 32px;
    text-decoration: none;
}
.dvt-participate__modal-account:hover { background: #f2f6f2; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .dvt-participate__form.dvt-participate__grid,
    .dvt-participate__grid { grid-template-columns: 1fr; gap: 24px; }
    .dvt-participate__col--drop { order: -1; } /* photo picker first on mobile */
}
