/**
 * Estilos Públicos do Plugin Canal de Denúncias
 * Alinhado aos padrões e design tokens da Hostweb (hostweb.com.br).
 * Cores, gradiente do CTA, tipografia e bordas idênticos ao site oficial.
 */

:root {
    --hostweb-red: #E20613;
    --hostweb-magenta: #9D1258;
    --hostweb-purple: #640D70;
    --hostweb-purple-dark: #4B075E;
    --hostweb-cta-start: #510680;
    --hostweb-cta-end: #E20613;
    --hostweb-blue: #00A9EE;
    --hostweb-blue-dark: #0170B9;
    --hostweb-navy: #181F2E;
    --hostweb-text: #1B1E34;
    --hostweb-text-muted: #5A5F73;
    --hostweb-surface: #FFFFFF;
    --hostweb-surface-soft: #F5F5F7;
    --hostweb-border: #E4E4E8;
    --hostweb-error: #C62828;
    --hostweb-success: #2E7D32;
    --hostweb-radius: 12px;
    --hostweb-shadow: 0 8px 28px rgba(27, 30, 52, 0.12), 0 1px 3px rgba(27, 30, 52, 0.06);
}

.cdn-container {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: 820px;
    margin: 32px auto;
    padding: 34px 30px 28px;
    background: var(--hostweb-surface, #ffffff);
    border: 1px solid var(--hostweb-border, #E4E4E8);
    border-radius: var(--hostweb-radius, 12px);
    box-shadow: var(--hostweb-shadow);
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--hostweb-text, #1B1E34);
    line-height: 1.6;
    overflow: hidden;
}

.cdn-container *,
.cdn-container *::before,
.cdn-container *::after {
    box-sizing: inherit;
}

/* Faixa superior de marca Hostweb (vermelho → magenta → roxo) */
.cdn-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--hostweb-red, #E20613) 0%,
        var(--hostweb-magenta, #9D1258) 48%,
        var(--hostweb-purple, #640D70) 100%
    );
}

/* Caixa de Introdução Institucional */
.cdn-intro-box {
    margin-bottom: 24px;
    padding: 20px 22px;
    background: var(--hostweb-surface-soft, #f8fafc);
    border-left: 4px solid var(--hostweb-purple, #640D70);
    border-radius: 0 10px 10px 0;
    font-size: 0.95rem;
    color: var(--hostweb-text, #1B1E34);
    line-height: 1.65;
}

.cdn-intro-box p {
    margin: 0 0 12px 0;
}

.cdn-intro-box p:last-child {
    margin-bottom: 0;
}

/* Alertas de Notificação */
.cdn-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.cdn-alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.cdn-alert-content {
    flex: 1;
}

.cdn-alert-content p {
    margin: 0 0 6px 0;
}

.cdn-alert-content p:last-child {
    margin-bottom: 0;
}

.cdn-alert-content ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.cdn-alert-success {
    background: #E8F5E9;
    border-left: 4px solid var(--hostweb-success, #2E7D32);
    border-radius: 8px;
    color: #1e4620;
}

.cdn-alert-success .cdn-alert-icon {
    color: var(--hostweb-success, #2E7D32);
}

.cdn-alert-error {
    background: #FDECEA;
    border-left: 4px solid var(--hostweb-error, #C62828);
    border-radius: 8px;
    color: #8c1d1d;
}

.cdn-alert-error .cdn-alert-icon {
    color: var(--hostweb-error, #C62828);
}

/* Botão de Trigger (Abertura do Formulário) */
.cdn-trigger-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 28px 0 16px;
}

.cdn-btn-icon {
    flex-shrink: 0;
}

/* Botões com Padrão de Cores Hostweb (Gradiente 268deg roxo → vermelho) */
.cdn-btn-trigger,
a.cdn-btn-trigger,
.cdn-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px !important;
    height: auto !important;
    padding: 0.65rem 1.85rem !important;
    border: 0 !important;
    border-radius: 12px !important;
    background-color: transparent !important;
    background-image: linear-gradient(268deg, var(--hostweb-cta-start, #510680) 0%, var(--hostweb-cta-end, #E20613) 100%) !important;
    color: #ffffff !important;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: 0 6px 14px rgba(81, 6, 128, 0.22) !important;
    cursor: pointer;
    transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cdn-btn-trigger:hover,
a.cdn-btn-trigger:hover,
.cdn-btn-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 24px rgba(226, 6, 19, 0.3) !important;
    color: #ffffff !important;
    background-image: linear-gradient(268deg, var(--hostweb-cta-start, #510680) 0%, var(--hostweb-cta-end, #E20613) 100%) !important;
    transform: translateY(-1px);
}

.cdn-btn-trigger:active,
a.cdn-btn-trigger:active,
.cdn-btn-submit:active {
    transform: translateY(1px);
    filter: brightness(0.97);
}

.cdn-btn-trigger:focus-visible,
.cdn-btn-submit:focus-visible {
    outline: 2px solid var(--hostweb-purple, #640D70);
    outline-offset: 3px;
}

/* Ações de Reset */
.cdn-actions-reset {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Bloco Retrátil do Formulário */
.cdn-form-collapse {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--hostweb-border, #E4E4E8);
}

.cdn-form-collapse.cdn-is-open {
    display: block !important;
    animation: cdnFadeSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cdnFadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cdn-form-collapse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--hostweb-border, #E4E4E8);
}

.cdn-form-collapse-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hostweb-navy, #181F2E);
}

.cdn-form-collapse-title svg {
    color: var(--hostweb-purple, #640D70);
    flex-shrink: 0;
}

.cdn-btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--hostweb-text-muted, #5A5F73);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.cdn-btn-close:hover {
    background-color: var(--hostweb-surface-soft, #F5F5F7);
    color: var(--hostweb-red, #E20613);
}

/* Grupos de Campos */
.cdn-field-group {
    margin-bottom: 22px;
}

.cdn-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--hostweb-navy, #181F2E);
}

.cdn-required-mark {
    color: var(--hostweb-red, #E20613);
    margin-left: 3px;
    font-weight: 700;
}

.cdn-help-text {
    margin: 6px 0 0 0;
    font-size: 0.82rem;
    color: var(--hostweb-text-muted, #5A5F73);
    line-height: 1.4;
}

/* Inputs de Texto, Textareas e Selects */
.cdn-input,
.cdn-textarea,
.cdn-select {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--hostweb-text, #1B1E34);
    background-color: #ffffff;
    border: 1px solid var(--hostweb-border, #E4E4E8);
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
}

.cdn-input:focus,
.cdn-textarea:focus,
.cdn-select:focus {
    outline: none;
    border-color: var(--hostweb-purple, #640D70);
    box-shadow: 0 0 0 3px rgba(100, 13, 112, 0.12);
}

.cdn-input::placeholder,
.cdn-textarea::placeholder {
    color: #9ca3af;
}

.cdn-textarea {
    resize: vertical;
    min-height: 110px;
}

.cdn-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%235A5F73%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Radio Buttons e Checkbox */
.cdn-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.cdn-radio-label,
.cdn-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--hostweb-text, #1B1E34);
    user-select: none;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.cdn-radio-label:hover,
.cdn-checkbox-label:hover {
    background-color: var(--hostweb-surface-soft, #F5F5F7);
}

.cdn-radio-label input[type="radio"],
.cdn-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    accent-color: var(--hostweb-purple, #640D70);
    cursor: pointer;
}

.cdn-checkbox-wrap {
    background: var(--hostweb-surface-soft, #f8fafc);
    border: 1px solid var(--hostweb-border, #E4E4E8);
    border-radius: 8px;
    padding: 12px 14px;
}

/* Área de Submissão */
.cdn-form-submit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.cdn-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.65rem 1.5rem;
    background: transparent;
    border: 1px solid var(--hostweb-border, #E4E4E8);
    border-radius: 12px;
    color: var(--hostweb-text-muted, #5A5F73);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cdn-btn-cancel:hover {
    background: var(--hostweb-surface-soft, #F5F5F7);
    color: var(--hostweb-navy, #181F2E);
    border-color: #cbd5e1;
}

/* Responsividade Mobile (< 640px) */
@media (max-width: 639px) {
    .cdn-container {
        padding: 22px 16px 20px;
        margin: 16px auto;
        border-radius: 10px;
    }

    .cdn-intro-box {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .cdn-trigger-wrap {
        margin: 20px 0 12px;
    }

    .cdn-btn-trigger,
    a.cdn-btn-trigger,
    .cdn-btn-submit {
        width: 100%;
        min-height: 46px !important;
        font-size: 0.95rem !important;
        padding: 0.65rem 1.25rem !important;
    }

    .cdn-btn-cancel {
        width: 100%;
        min-height: 44px;
    }

    .cdn-form-submit {
        flex-direction: column;
        gap: 10px;
    }
}

/* Acessibilidade - Preferência por redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .cdn-btn-trigger,
    a.cdn-btn-trigger,
    .cdn-btn-submit,
    .cdn-btn-cancel {
        transition: none !important;
        animation: none !important;
    }
    .cdn-form-collapse.cdn-is-open {
        animation: none !important;
    }
}
