/* =========================================================
   OIC Denuncia - Stylesheet
   - Variables por tema (oscuro/claro)
   - Corrección de colores inline (texto blanco fijo)
   - Componentes: toolbar, badge, inputs, botón, mensajes
   - Ancla con offset para headers fijos
   ========================================================= */

/* ---------- Base + Variables ---------- */
.oic-form{
  /* Valores por defecto (se sobreescriben por tema) */
  --oic-bg: #2c3345;
  --oic-fg: #ffffff;
  --oic-link: #c4d3ff;
  --oic-border: rgba(34,41,77,.9);

  --oic-badge-bg: #e7f8ef;
  --oic-badge-fg: #106a36;

  --oic-input-bg: #ffffff;
  --oic-input-fg: #111827;
  --oic-input-border: #cbd5e1;
  --oic-input-focus: #dbb550;

  --oic-btn-bg: #2b2a40;
  --oic-btn-fg: #ffffff;
  --oic-btn-bg-hover: #dbb550;
  --oic-btn-fg-hover: #2b2a40;

  --oic-card-radius: 14px;
  --oic-shadow: 0 10px 24px rgba(0,0,0,.06);

  background: var(--oic-bg);
  color: var(--oic-fg);
  border: 1px solid var(--oic-border);
  border-radius: var(--oic-card-radius);
  box-shadow: var(--oic-shadow);

  padding: 1.25rem;
  margin: 1.25rem auto;
  max-width: 760px;

  font-family: "Inter","Segoe UI","Roboto",system-ui,-apple-system,sans-serif;
  line-height: 1.6;

  transition: background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}

/* ---------- Tema oscuro (por defecto) ---------- */
.oic-form.oic-theme-dark{
  --oic-bg: #2c3345;
  --oic-fg: #ffffff;
  --oic-link: #c4d3ff;
  --oic-border: rgba(34,41,77,.9);

  --oic-badge-bg: #e7f8ef;
  --oic-badge-fg: #106a36;

  --oic-input-bg: #ffffff;
  --oic-input-fg: #111827;
  --oic-input-border: #cbd5e1;
  --oic-input-focus: #dbb550;
}

/* ---------- Tema claro ---------- */
.oic-form.oic-theme-light{
  --oic-bg: #ffffff;
  --oic-fg: #22294d;
  --oic-link: #1a2f6b;
  --oic-border: transparent;

  --oic-badge-bg: #eef2ff;
  --oic-badge-fg: #1e3a8a;

  --oic-input-bg: #ffffff;
  --oic-input-fg: #111827;
  --oic-input-border: #cbd5e1;
  --oic-input-focus: #dbb550;

  border: none;
}

/* ---------- Normalización de colores (apaga inline) ---------- */
/* Todo lo dentro de .oic-content toma el color de tema */
.oic-form .oic-content,
.oic-form .oic-content *{
  color: var(--oic-fg) !important;
}

/* Links (incluye los con estilos inline heredados) */
.oic-form a{
  color: var(--oic-link) !important;
  text-decoration: underline;
}

/* ---------- Toolbar / Estado / Toggle ---------- */
.oic-form .oic-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.oic-form .oic-horario{
  font-size: .95rem;
}

.oic-form .oic-badge{
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--oic-badge-bg);
  color: var(--oic-badge-fg);
  margin-right: .5rem;
}

.oic-form .oic-theme-toggle{
  font-size: .85rem;
  line-height: 1;
  padding: .5rem .7rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f5f5f5;
  cursor: pointer;
}

.oic-form #oic-theme-status{
  font-size: .9rem;
  opacity: .9;
}

/* ---------- Tipografía ---------- */
.oic-form p{
  margin: .35rem 0 .8rem;
}

.oic-form strong, .oic-form b{
  font-weight: 700;
}

/* ---------- Campos ---------- */
.oic-form .oic-field{
  margin: 10px 0;
}

.oic-form input[type="file"]{
  width: 100%;
  padding: .7rem;
  border-radius: 10px;
  border: 1px solid var(--oic-input-border);
  background: var(--oic-input-bg);
  color: var(--oic-input-fg);
  font-size: 1rem;
  transition: box-shadow .2s, border-color .2s, background-color .2s;
}

.oic-form input[type="file"]:hover,
.oic-form input[type="file"]:focus{
  outline: none;
  border-color: var(--oic-input-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--oic-input-focus) 20%, transparent);
}

/* Checkbox y etiqueta */
.oic-form .oic-priv{
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  background: color-mix(in srgb, var(--oic-bg) 5%, #fff);
  border-radius: 10px;
}

.oic-form .oic-priv-row{
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.oic-form input[type="checkbox"]{
  width: 20px;
  height: 20px;
  margin-top: .25rem;
}

/* ---------- Botón enviar ---------- */
.oic-form .oic-submit{
  display: inline-block;
  background: var(--oic-btn-bg);
  color: var(--oic-btn-fg);
  border: none;
  border-radius: 12px;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .05s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}

.oic-form .oic-submit:hover{
  background: var(--oic-btn-bg-hover);
  color: var(--oic-btn-fg-hover);
}

.oic-form .oic-submit:active{
  transform: translateY(1px);
}

/* ---------- Enlaces útiles ---------- */
.oic-form .oic-download{
  display: inline-block;
  padding: .55rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--oic-input-focus);
  background: color-mix(in srgb, var(--oic-bg) 5%, #fff);
  text-decoration: none;
  font-weight: 600;
}

.oic-form .oic-download:hover{
  background: #fff7e5;
}

/* ---------- Mensaje de éxito ---------- */
.oic-form .oic-success{
  margin-top: .75rem;
  padding: .8rem 1rem;
  background: #e7f9ef;
  border: 1px solid #28a745;
  border-left: 6px solid #28a745;
  color: #0a3d20;
  font-size: 1rem;
  border-radius: 8px;
}

/* ---------- Anchor con offset para headers fijos ---------- */
#oic-form-anchor{
  position: relative;
  display: block;
}
#oic-form-anchor::before{
  content:"";
  display:block;
  height: 120px;          /* ajusta según tu header */
  margin-top:-120px;
  visibility:hidden;
}

@media (max-width: 782px){
  #oic-form-anchor::before{
    height: 160px;
    margin-top:-160px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px){
  .oic-form{
    margin: .75rem;
    padding: 1rem;
  }
  .oic-form .oic-toolbar{
    gap: .5rem;
  }
}

/* ---------- Accesibilidad y estados ---------- */
.oic-form a:focus,
.oic-form button:focus,
.oic-form input:focus{
  outline: 2px solid color-mix(in srgb, var(--oic-input-focus) 60%, #0000);
  outline-offset: 2px;
}

/* ---------- Dureza extra contra estilos inline heredados del tema ---------- */
/* Si hay párrafos con color inline (ej. color:#fff), herédalo del tema */
.oic-form p[style],
.oic-form em[style],
.oic-form strong[style],
.oic-form a[style],
.oic-form span[style]{
  color: inherit !important;
}
