/* ================================================= */
/* RESET                                             */
/* ================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================= */
/* VARIÁVEIS GLOBAIS                                 */
/* ================================================= */
:root {
  /* Cores */
  --color-primary: #e85b2b;
  --color-secondary: #222;
  --color-muted: #777;
  --color-bg: #ffffff;
  --color-light: #f5f5f5;

  /* Tipografia */
  --font-base: 'Inter', Arial, Helvetica, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* UI */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition-fast: 0.2s ease;
}

/* ================================================= */
/* BASE GLOBAL                                       */
/* ================================================= */
html {
  font-size: 100%;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-secondary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ================================================= */
/* ELEMENTOS GLOBAIS                                 */
/* ================================================= */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #c7471e;
}

img {
  max-width: 100%;
  display: block;
}

/* ================================================= */
/* UTILITÁRIOS                                       */
/* ================================================= */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ================================================= */
/* PLUGIN CLP – FRONTEND                             */
/* ================================================= */

/* ---------- WRAPPER ---------- */
.clp-wrap {
  max-width: 1080px;
  width: 100%;
  margin: 40px auto;
  padding: 32px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* ---------- FORMULÁRIO DE BUSCA ---------- */
.clp-search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
  margin: 0 auto;
  align-items: stretch;
}

.clp-search-form p {
  grid-column: 1 / -1;
  text-align: center;
}

.clp-search-form .button {
  padding: 10px 28px;
}

/* ---------- CAMPOS ---------- */
.clp-field {
  display: flex;
  flex-direction: column;
}

.clp-field label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.clp-field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.clp-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(232,91,43,.35);
}

/* ---------- RESULTADO ---------- */
.clp-result {
  margin-top: 24px;
}

/* ---------- CONFIRMAÇÃO ---------- */
.clp-confirm-wrap {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.clp-confirm-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

/* campos largura total */
.clp-confirm-form input[name="nome"],
.clp-confirm-form input[name="logradouro"],
.clp-confirm-form input[name="email"] {
  grid-column: 1 / -1;
}

.clp-invalid{
    border:2px solid #e74c3c !important;
    background:#fff6f6;
}

/* ---------- CAMPOS BLOQUEADOS ---------- */
.clp-locked {
  background: #f6f7f7;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.clp-locked strong {
  font-size: 14px;
}

/* ---------- MENSAGENS ---------- */
.clp-messages {
  margin-bottom: 16px;
  font-size: 14px;
}

.clp-messages.success { color: #0a7a32; }
.clp-messages.error { color: #b32d2e; }

/* ---------- BOTÃO FINAL ---------- */
.clp-confirm-form .button-primary {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 10px 28px;
}

.clp-error {
    background: #ffeaea;
    color: #b30000;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: 500;
}

/* ==========================
   SELECT igual aos inputs
========================== */

.clp-field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Remove estilo feio padrão */
.clp-field select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Seta customizada */
.clp-field {
    position: relative;
}

.clp-field select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 35px;
}
.clp-submit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.clp-required-info {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.clp-asterisk {
    color: #d63638;
    font-weight: bold;
}


.clp-help-trigger {
    cursor: pointer;
    font-size: 14px;
    margin-left: 6px;
    opacity: .6;
    transition: .2s;
}

.clp-help-trigger:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Modal base */

/* ==========================
   RESET INTERNO DO MODAL
========================== */

.clp-help-modal {
    position: fixed;
    inset: 0;
    display: none;              /* começa fechado */
    z-index: 999999;

    align-items: center;        /* centraliza vertical */
    justify-content: center;    /* centraliza horizontal */
    padding: 20px;              /* não gruda na borda */
}

.clp-help-modal.active {
    display: flex;
}

.clp-help-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clp-help-modal,
.clp-help-modal * {
    box-sizing: border-box;
}

.clp-help-modal h3,
.clp-help-modal p {
    margin: 0;
    padding: 0;
}

.clp-help-modal h3.clp-help-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.clp-help-modal p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    font-weight: 600; /* adiciona negrito */
    text-align: justify;
    text-justify: inter-word;
}

/* Remove possíveis estilos agressivos do tema */
.clp-help-modal h3,
.clp-help-modal p,
.clp-help-modal button {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}

.clp-help-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.clp-help-content {
    position: relative;
    width: 95%;
    max-width: 700px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
}

.clp-help-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    transition: background .2s ease;
}

.clp-help-close:hover {
    background: rgba(0,0,0,.05);
}

/* Imagem */
.clp-help-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none; /* remove limite */
    border-radius: 10px;
}

.clp-help-text {
    order: 1;
}

.clp-help-image {
    order: 2;
    width: 100%;
}


/* Texto */
.clp-help-text h3 {
    margin-top: 0;
}


/* ================================================= */
/* RESPONSIVO                                        */
/* ================================================= */
@media (max-width: 600px) {
    .clp-help-body {
        flex-direction: column;
      }

    /*.clp-help-image img {
        max-width: 300px;
    }*/
}

@media (max-width: 768px) {
  .clp-wrap {
    margin: 20px 12px;
    padding: 20px;
  }

  .clp-confirm-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .clp-search-form {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

@media (max-width: 600px) {

    .clp-help-content {
        width: 98%;
        padding: 15px;
        margin: 10% auto;
    }

    .clp-help-title {
        font-size: 18px;
    }

    .clp-help-image img {
        border-radius: 8px;
    }
}

@media (max-width: 600px) {
    .clp-help-modal p {
        font-size: 15px;
    }
}