/* =============================================================
   Wizard Ouvidoria — estilos do formulário público em iframe
   Tokens: azul-escuro #15497B | azul-claro #7CB3DA | link #1A6CB5
   ============================================================= */

/* ---- Card container ---------------------------------------- */
.wizard-card {
    background: #fff;
    border: 1px solid #D9D9D9;
    border-radius: 12px;
    padding: 28px 32px 24px;
    max-width: 780px;
    margin: 16px auto;
    box-sizing: border-box;
}

/* ---- Stepper ----------------------------------------------- */
.wizard-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    min-width: 64px;
    flex-shrink: 0;
}

.wizard-step-indicator.completed {
    cursor: pointer;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #7CB3DA;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.wizard-step-indicator.active .step-circle {
    background: #15497B;
    box-shadow: 0 2px 8px rgba(21, 73, 123, 0.35);
}

.wizard-step-indicator.completed .step-circle {
    background: #15497B;
}

.wizard-step-indicator.completed .step-circle::after {
    content: '✓';
    font-size: 13px;
}
.wizard-step-indicator.completed .step-circle {
    font-size: 0;
}
.wizard-step-indicator.completed .step-circle::after {
    font-size: 15px;
}

.step-label {
    font-size: 11px;
    text-align: center;
    margin-top: 6px;
    color: #aaa;
    line-height: 1.3;
    max-width: 80px;
    word-wrap: break-word;
    transition: color 0.2s;
}

.wizard-step-indicator.active .step-label {
    color: #15497B;
    font-weight: 600;
}

.wizard-step-indicator.completed .step-label {
    color: #555;
}

.step-connector {
    flex: 1;
    height: 2px;
    border-top: 2px dashed #7CB3DA;
    margin-top: 18px;
    min-width: 24px;
    flex-shrink: 1;
}

/* ---- Step content ------------------------------------------ */
.wizard-step {
    display: none;
    animation: fadeStep 0.2s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeStep {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Field labels ------------------------------------------ */
.field-label {
    display: block !important;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

/* ---- Inputs / selects -------------------------------------- */
.wizard-card .form-control {
    border: 1px solid #C8D6E0;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
}

.wizard-card .form-control:focus {
    border-color: #1A6CB5;
    box-shadow: 0 0 0 2px rgba(26, 108, 181, 0.15);
    outline: none;
}

.wizard-card .form-control.wizard-field-error {
    border-color: #c0392b !important;
}

.wizard-card input[type="checkbox"].wizard-field-error {
    outline: 2px solid #c0392b;
    outline-offset: 1px;
}

.wizard-card .radio-container.wizard-field-error {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #c0392b;
    border-radius: 4px;
}

.wizard-field-error-msg {
    margin-top: 4px;
    font-size: 12px;
    color: #c0392b;
}

/* obrigatórios: classe "required" posta pelo Wicket no <label wicket:for>
   (e pelo JS, nos obrigatórios condicionais ao meio de resposta) */
.field-label.required::after,
.wizard-checkbox-wrap input[data-required="true"] + span::after,
.wizard-checkbox-wrap input[data-required="true"] + .wizard-checkbox-label::after {
    content: " *";
    color: #c0392b;
}

/* ---- Section title (passo) --------------------------------- */
.wizard-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #15497B;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #EEF4FA;
}

/* ---- Textarea ---------------------------------------------- */
.wizard-card textarea.form-control {
    resize: vertical;
    min-height: 140px;
}

/* ---- Character counter ------------------------------------ */
#contaTextoOriginal {
    font-size: 12px;
    margin-top: 4px;
    display: inline-block;
}

/* ---- Dropzone --------------------------------------------- */
.dropzone-area {
    border: 2px dashed #7CB3DA;
    border-radius: 8px;
    background: #F4F8FC;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
}

.dropzone-area:hover,
.dropzone-area.dragover {
    background: #E8F1FA;
    border-color: #15497B;
}

.dropzone-icon {
    margin-bottom: 10px;
    color: #7CB3DA;
}

.dropzone-icon svg {
    width: 40px;
    height: 40px;
}

.dropzone-title {
    font-size: 14px;
    font-weight: 600;
    color: #15497B;
    margin-bottom: 4px;
}

/* texto alternativo para telas de toque (ver "@media (hover: none)") */
.dropzone-title-touch {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: #15497B;
    margin-bottom: 4px;
}

.dropzone-subtitle {
    font-size: 13px;
    color: #555;
}

.dropzone-hint {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
}

.dropzone-filename {
    font-size: 12px;
    color: #1A6CB5;
    margin-top: 6px;
    word-break: break-all;
}

/* ---- Radio buttons (tipoTelefone) -------------------------- */
.radio-container label {
    font-weight: normal;
    margin-right: 12px;
    font-size: 13px;
}

/* ---- Checkbox labels -------------------------------------- */
.wizard-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 6px;
}

.wizard-checkbox-wrap input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #15497B;
}

.wizard-checkbox-wrap span,
.wizard-checkbox-wrap .wizard-checkbox-label {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

/* texto do checkbox clicável (<label wicket:for>): neutraliza o label do Bootstrap.
   O asterisco vem só da regra input[data-required] + label (a classe "required" que o
   Wicket põe no label não gera outro). */
.wizard-checkbox-wrap .wizard-checkbox-label {
    display: block;
    font-weight: normal;
    margin-bottom: 0;
    max-width: none;
    cursor: pointer;
}

/* ---- LGPD text -------------------------------------------- */
.lgpd-text {
    background: #F7FAFD;
    border-left: 3px solid #7CB3DA;
    border-radius: 0 6px 6px 0;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: #444;
    line-height: 1.6;
    text-align: justify;
}

.lgpd-warning {
    color: #c0392b;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

/* ---- Navigation ------------------------------------------- */
.wizard-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #EEF4FA;
    gap: 16px;
}

.wizard-btn-nav {
    font-size: 14px;
    font-weight: 600;
    color: #1A6CB5;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.wizard-btn-nav:hover {
    background: #EEF4FA;
    color: #15497B;
    text-decoration: none;
}

.wizard-btn-nav.disabled,
.wizard-btn-nav[disabled] {
    color: #bbb;
    pointer-events: none;
}

.wizard-nav-sep {
    color: #ccc;
    font-size: 18px;
    line-height: 1;
}

/* ---- Submit area ------------------------------------------ */
.wizard-submit-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.wizard-btn-submit {
    background: #15497B !important;
    border: 1px solid #0f3558 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.wizard-btn-submit:hover:not([disabled]) {
    background: #0f3558 !important;
}

.wizard-btn-submit[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.wizard-btn-limpar {
    background: #f0f0f0;
    border: 1px solid #bbb;
    color: #555;
    font-size: 14px;
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
}

.wizard-btn-limpar:hover {
    background: #e0e0e0;
}

/* ---- Confirmação de Limpar (no lugar dos botões) ---- */
.wizard-confirm {
    margin-top: 24px;
    padding: 16px 20px;
    background: #f4f8fc;
    border: 1px solid #7CB3DA;
    border-radius: 8px;
    text-align: center;
}

.wizard-confirm-msg {
    margin: 0 0 14px;
    font-size: 14px;
    color: #15497B;
    font-weight: 600;
}

.wizard-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---- Validation error banner ------------------------------ */
.wizard-validation-msg {
    display: none;
    background: #fdf3f2;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 14px;
}

/* ---- Feedback panel (on top) ------------------------------ */
#ouvidoria-feedback {
    margin-bottom: 12px;
}

/* ---- Responsive -------------------------------------------
   No portal, o viewport deste documento é a largura do iframe: com o iframe fixo
   de 770px (portal atual) nenhuma regra abaixo dispara e o layout fica como na
   2.0.0; com o iframe fluido (portal ajustado, #269064) elas passam a valer.
   Breakpoints do Bootstrap 3: <= 767px (xs), <= 480px e <= 359px. */
html, body {
    overflow-x: hidden;
}

.wizard-card {
    width: auto;
}

.wizard-card img,
.wizard-card svg {
    max-width: 100%;
}

#ouvidoria-feedback .alert {
    word-wrap: break-word;
}

@media (max-width: 767px) {
    .wizard-card {
        padding: 20px 16px;
        border-radius: 8px;
        margin: 8px;
    }

    /* campos: 16px evita o zoom automático do iOS ao focar; 44px de altura (toque) */
    .wizard-card .form-control {
        font-size: 16px;
        min-height: 44px;
    }

    .wizard-card .select2-container .select2-choice {
        font-size: 16px;
        height: 44px;
        min-height: 44px;
        line-height: 30px;
    }

    .wizard-card .select2-container .select2-choice .select2-arrow b {
        background-position: 0 9px;
    }

    .wizard-card .select2-dropdown-open .select2-choice .select2-arrow b {
        background-position: -18px 9px;
    }

    .select2-drop .select2-search input {
        font-size: 16px;
    }

    /* navegação Anterior/Próxima */
    .wizard-navigation {
        justify-content: space-between;
    }

    .wizard-btn-nav {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 10px 16px;
        border: 1px solid #C8D6E0;
    }

    /* o JS alterna o separador com .toggle(): só !important o mantém oculto */
    #wizardNavSep {
        display: none !important;
    }

    #btnProxima {
        margin-left: auto;
    }

    /* Limpar/Enviar e botões da confirmação */
    .wizard-btn-submit,
    .wizard-btn-limpar {
        min-height: 44px;
        font-size: 16px;
    }

    /* checkboxes e rádios maiores, com área clicável >= 24px */
    .wizard-checkbox-wrap input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-top: 2px;
    }

    .wizard-checkbox-wrap .wizard-checkbox-label {
        min-height: 24px;
        padding: 2px 0;
        font-size: 14px;
    }

    /* RadioChoice renderiza input+label soltos no span: em grade, cada opção vira
       uma linha (o label nunca quebra longe do seu rádio) */
    .wizard-card .radio-container,
    .wizard-card .radio-container.wizard-field-error {
        display: grid;
        grid-template-columns: 20px 1fr;
        column-gap: 8px;
        align-items: center;
    }

    .radio-container input[type="radio"] {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    .radio-container label {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding-right: 16px;
        margin-right: 0;
        margin-bottom: 0;
        font-size: 14px;
        cursor: pointer;
    }

    /* coluna estreita: justificado forma "rios" de espaço */
    .lgpd-text {
        text-align: left;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .step-label {
        display: none;
    }

    .step-connector {
        min-width: 12px;
    }

    .wizard-step-indicator {
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    /* botões empilhados na largura toda; Enviar (ação primária) em cima, sem
       mudar a ordem do DOM */
    #wizardSubmitArea,
    .wizard-confirm-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    #wizardSubmitArea input,
    .wizard-confirm-actions button {
        width: 100%;
        min-height: 48px;
    }

    #wizardNav .wizard-btn-nav {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .dropzone-area {
        padding: 16px 12px;
    }

    .dropzone-icon svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 400px) {
    .wizard-stepper {
        justify-content: space-around;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

@media (max-width: 359px) {
    /* reCAPTCHA tem 304px fixos: reduz para caber no card (78px x 0,86 = 68px).
       data-size="compact" exigiria grecaptcha.render explícito. */
    .recaptcha-wrap {
        height: 68px;
    }

    .recaptcha-wrap .g-recaptcha {
        transform: scale(0.86);
        transform-origin: center top;
    }
}

/* telas de toque: "arrastar e soltar" não se aplica */
@media (hover: none) {
    .dropzone-title {
        display: none;
    }

    .dropzone-title-touch {
        display: block;
    }
}

/* ---- Select2 overrides (keep white bg in card) ------------ */
.wizard-card .select2-container .select2-choice {
    height: 34px;
    padding: 6px 12px;
    border: 1px solid #C8D6E0;
    border-radius: 6px;
    line-height: 22px;
    color: #555;
    background: #fff !important;
}

.wizard-card .select2-container-active .select2-choice {
    border-color: #1A6CB5;
    outline: 0;
    background: #fff !important;
}

.wizard-card .select2-drop {
    border-radius: 0 0 6px 6px;
    background: #fff !important;
}

.wizard-card .select2-search input {
    height: 30px;
    padding: 6px 12px;
    color: #555;
    background: #fff !important;
}

.wizard-card .select2-default .select2-chosen {
    color: #999;
    background: #fff !important;
}

.wizard-card .select2-container .select2-chosen {
    color: #555;
    background: #fff !important;
}

.wizard-card .select2-container .select2-choice .select2-arrow {
    background: #fff !important;
    border-left: 1px solid #C8D6E0;
}

/* ---- reCAPTCHA container ---------------------------------- */
.recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 8px;
}

#g-recaptcha-error {
    text-align: center;
    min-height: 20px;
    font-size: 13px;
}
