/**
 * assets/css/style.css
 *
 * Estilos del formulario público del Libro de Reclamaciones.
 *
 * ─────────────────────────────────────────────────────────────────────────────
 * PERSONALIZACIÓN RÁPIDA
 * ─────────────────────────────────────────────────────────────────────────────
 * El color principal se controla desde WP Admin → Reclamaciones → Ajustes.
 * Ese color se inyecta como variable CSS:  --lr-color-primario
 *
 * Estructura de clases:
 *   .lr-formulario-wrapper  → Contenedor raíz (toda la sección)
 *   .lr-intro               → Texto introductorio
 *   .lr-form                → El formulario en sí
 *   .lr-seccion             → Cada bloque numerado (1, 2, 3, 4)
 *   .lr-campo               → Cada campo individual (label + input + error)
 *   .lr-input               → Todos los <input>
 *   .lr-textarea            → Todos los <textarea>
 *   .lr-btn-submit          → Botón de envío
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Variables CSS ────────────────────────────────────────────────────────── */
:root {
    --lr-color-primario:  #c8001e;    /* Se sobreescribe desde PHP con el color del ajuste */
    --lr-color-texto:     #333333;
    --lr-color-borde:     #cccccc;
    --lr-color-fondo:     #f9f9f9;
    --lr-color-error:     #dc3545;
    --lr-color-exito:     #198754;
    --lr-radio:           4px;        /* Border radius de los inputs */
    --lr-fuente:          -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Contenedor principal ─────────────────────────────────────────────────── */
.lr-formulario-wrapper {
    font-family: var(--lr-fuente);
    color:       var(--lr-color-texto);
    max-width:   860px;
    margin:      0 auto;
    padding:     0 10px;
    line-height: 1.6;
}

/* ── Texto introductorio ──────────────────────────────────────────────────── */
.lr-intro {
    background: #f0f4ff;
    border-left: 4px solid var(--lr-color-primario);
    padding:     16px 20px;
    margin-bottom: 20px;
    border-radius: 0 var(--lr-radio) var(--lr-radio) 0;
}
.lr-intro h2 {
    margin:    0 0 10px;
    font-size: 18px;
    color:     var(--lr-color-primario);
}
.lr-intro p {
    margin: 6px 0;
    font-size: 14px;
}

/* ── Encabezado del formulario (fecha + número de hoja) ───────────────────── */
.lr-form-header {
    display:         flex;
    justify-content: space-between;
    align-items:     flex-start;
    border:          1px solid var(--lr-color-borde);
    padding:         12px 16px;
    margin-bottom:   10px;
    flex-wrap:       wrap;
    gap:             10px;
}
.lr-form-header-fecha label {
    font-weight: bold;
    margin-right: 8px;
}
.lr-fecha-campos {
    display:    inline-flex;
    gap:        6px;
    flex-wrap:  wrap;
    margin-top: 4px;
}
.lr-fecha-select {
    padding:       4px 6px;
    border:        1px solid var(--lr-color-borde);
    border-radius: var(--lr-radio);
    font-size:     13px;
}
.lr-form-header-hoja {
    text-align: right;
}
.lr-form-header-hoja strong {
    display:    block;
    font-size:  13px;
    text-transform: uppercase;
}
.lr-numero-hoja {
    font-size:   16px;
    font-weight: bold;
    color:       var(--lr-color-primario);
}

/* ── Datos de la empresa ──────────────────────────────────────────────────── */
.lr-empresa-info {
    background:    #f5f5f5;
    padding:       8px 14px;
    font-size:     13px;
    font-weight:   bold;
    margin-bottom: 20px;
    border:        1px solid var(--lr-color-borde);
}

/* ── Secciones numeradas ──────────────────────────────────────────────────── */
.lr-seccion {
    border:        1px solid var(--lr-color-borde);
    padding:       16px 20px;
    margin-bottom: 16px;
    border-radius: var(--lr-radio);
}
.lr-seccion-titulo {
    font-size:     13px;
    font-weight:   bold;
    text-transform: uppercase;
    color:         var(--lr-color-texto);
    margin:        0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--lr-color-primario);
}

/* ── Campos individuales ──────────────────────────────────────────────────── */
.lr-campo {
    margin-bottom: 14px;
}
.lr-campo label {
    display:     block;
    font-size:   12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    color:       #555;
}
.lr-campo label small {
    text-transform: none;
    font-weight:    normal;
    color:          #888;
}
.lr-requerido {
    color: var(--lr-color-error);
}

/* Dos campos en la misma fila */
.lr-campos-dobles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 580px) {
    .lr-campos-dobles { grid-template-columns: 1fr; }
}

/* ── Inputs y textareas ───────────────────────────────────────────────────── */
.lr-input,
.lr-textarea {
    width:         100%;
    padding:       8px 10px;
    border:        1px solid var(--lr-color-borde);
    border-radius: var(--lr-radio);
    font-size:     14px;
    font-family:   var(--lr-fuente);
    color:         var(--lr-color-texto);
    background:    #fff;
    box-sizing:    border-box;
    transition:    border-color 0.2s, box-shadow 0.2s;
}
.lr-input:focus,
.lr-textarea:focus {
    outline:      none;
    border-color: var(--lr-color-primario);
    box-shadow:   0 0 0 3px rgba(200, 0, 30, 0.1);
}
.lr-input-ok {
    border-color: var(--lr-color-exito);
}
.lr-input-error {
    border-color: var(--lr-color-error);
    background:   #fff8f8;
}
.lr-textarea {
    resize:     vertical;
    min-height: 100px;
}
.lr-textarea-readonly {
    background: #f5f5f5;
    color:      #888;
    cursor:     not-allowed;
}

/* ── Mensajes de error de campo ───────────────────────────────────────────── */
.lr-error-msg {
    display:    none;
    font-size:  12px;
    color:      var(--lr-color-error);
    margin-top: 4px;
}
.lr-error-msg.visible {
    display: block;
}

/* ── Contador de caracteres ───────────────────────────────────────────────── */
.lr-char-count {
    font-size:  11px;
    color:      #999;
    margin-top: 3px;
    display:    block;
}
.lr-char-ok    { color: var(--lr-color-exito); }
.lr-char-error { color: var(--lr-color-error); }

/* ── Radio buttons personalizados ─────────────────────────────────────────── */
.lr-radio-grupo {
    display:   flex;
    gap:       20px;
    flex-wrap: wrap;
    margin:    8px 0;
}
.lr-radio-label {
    display:     flex;
    align-items: center;
    gap:         8px;
    cursor:      pointer;
    font-size:   14px;
    font-weight: normal;
    color:       var(--lr-color-texto);
}
/* Ocultar el radio nativo */
.lr-radio-label input[type="radio"] {
    position: absolute;
    opacity:  0;
    width:    0;
    height:   0;
}
/* Círculo personalizado */
.lr-radio-custom {
    width:         18px;
    height:        18px;
    border:        2px solid var(--lr-color-borde);
    border-radius: 50%;
    display:       inline-block;
    flex-shrink:   0;
    transition:    border-color 0.2s, background 0.2s;
    position:      relative;
}
.lr-radio-label input[type="radio"]:checked + .lr-radio-custom {
    border-color: var(--lr-color-primario);
    background:   var(--lr-color-primario);
}
.lr-radio-label input[type="radio"]:checked + .lr-radio-custom::after {
    content:       '';
    position:      absolute;
    top:           3px; left: 3px;
    width:         8px; height: 8px;
    background:    #fff;
    border-radius: 50%;
}

/* ── Layout sección 2 ─────────────────────────────────────────────────────── */
.lr-bien-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 580px) {
    .lr-bien-row { grid-template-columns: 1fr; }
}
.lr-tipo-reclamo-row {
    display:     flex;
    align-items: center;
    gap:         16px;
    margin-top:  12px;
    flex-wrap:   wrap;
}
.lr-tipo-reclamo-label {
    font-size:   12px;
    font-weight: bold;
    text-transform: uppercase;
    color:       #555;
}

/* ── Nota legal ───────────────────────────────────────────────────────────── */
.lr-nota-legal {
    font-size:     12px;
    color:         #666;
    background:    #f9f9f9;
    padding:       10px 14px;
    border:        1px solid #e0e0e0;
    border-radius: var(--lr-radio);
    margin-bottom: 16px;
}
.lr-nota-legal p { margin: 3px 0; }

/* ── Mensaje general (éxito/error) ────────────────────────────────────────── */
.lr-mensaje {
    display:       none;
    padding:       12px 16px;
    border-radius: var(--lr-radio);
    margin-bottom: 16px;
    font-size:     14px;
    font-weight:   500;
}
.lr-mensaje-exito {
    background: #d1eddd;
    border:     1px solid #a3d9b5;
    color:      #0a5523;
}
.lr-mensaje-error {
    background: #fde8eb;
    border:     1px solid #f5b8c0;
    color:      #7a1520;
}

/* ── Botón de envío ───────────────────────────────────────────────────────── */
.lr-submit-area {
    text-align: center;
    margin-top: 10px;
}
.lr-btn-submit {
    background:     var(--lr-color-primario);
    color:          #ffffff;
    border:         none;
    padding:        14px 50px;
    font-size:      15px;
    font-weight:    bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius:  var(--lr-radio);
    cursor:         pointer;
    transition:     background 0.2s, transform 0.1s;
    min-width:      200px;
}
.lr-btn-submit:hover:not(:disabled) {
    filter: brightness(1.1);
}
.lr-btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}
.lr-btn-submit:disabled {
    opacity: 0.7;
    cursor:  not-allowed;
}

/* ── Panel de éxito (reemplaza el formulario tras el envío) ─────────────────── */
.lr-exito-panel {
    text-align:     center;
    padding:        40px 20px;
    background:     #f0fff4;
    border:         2px solid #a3d9b5;
    border-radius:  8px;
    margin-bottom:  20px;
}
.lr-exito-icon { font-size: 50px; margin-bottom: 12px; }
.lr-exito-panel h3 { color: var(--lr-color-exito); font-size: 18px; margin-bottom: 12px; }
.lr-exito-numero {
    font-size:   20px;
    margin:      12px 0;
}
.lr-exito-numero strong {
    color:        var(--lr-color-primario);
    font-size:    24px;
}
