/* Libro de Reclamaciones: estilos compartidos por el registro y la consulta de estado.
   Paleta del portal del socio (assets/css/client-ui.css): verde #087454. */
:root {
    --lr-green: #087454;
    --lr-green-dark: #06563f;
    --lr-green-deep: #064e3b;
    --lr-green-light: #149d75;
    --lr-tint: #eaf6f0;
    --lr-ink: #18352d;
    --lr-muted: #536960;
    /* Alias usados por todo el módulo */
    --primary-dark: var(--lr-green);
    --primary-green: #16a34a;
    --primary-red: #dc2626;
    --light-bg: #f5f8f6;
    --border-color: #dce8e1;
}

body {
    background-color: var(--light-bg);
    color: var(--lr-ink);
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ───────── Hero ───────── */
.lr-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 45%, #0d9668 100%);
    color: #fff;
    padding: 2.25rem 0 4rem;
}
.lr-hero::before,
.lr-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.lr-hero::before {
    width: 320px;
    height: 320px;
    right: -90px;
    top: -120px;
}
.lr-hero::after {
    width: 220px;
    height: 220px;
    left: -70px;
    bottom: -130px;
}
.lr-hero .container {
    position: relative;
    z-index: 1;
}
.lr-hero-grid {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    max-width: 980px;
    margin: 0 auto;
}
.lr-hero-libro {
    flex: 0 0 auto;
    background: #fff;
    border-radius: 22px;
    padding: 12px 16px;
    box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.5);
}
.lr-hero-libro img {
    display: block;
    width: 240px;
    height: auto;
}
.lr-hero-texto {
    flex: 1;
    min-width: 0;
}
.lr-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.lr-hero h1 {
    font-size: clamp(1.45rem, 2.6vw, 2.05rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0.75rem 0 0.5rem;
    color: #fff;
}
.lr-hero-lead {
    color: rgba(255, 255, 255, 0.88);
    max-width: 560px;
    margin: 0 0 1.15rem;
    font-size: 0.98rem;
}
.lr-hero-coop {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 0.45rem 0.95rem 0.45rem 0.45rem;
    text-align: left;
}
.lr-hero-coop img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    object-fit: contain;
}
.lr-hero-coop strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
}
.lr-hero-coop small {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
}

/* Pestañas Registrar / Consultar */
.lr-tabs {
    display: flex;
    gap: 6px;
    max-width: 560px;
    margin: -2rem auto 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 14px 32px -16px rgba(6, 78, 59, 0.45);
    position: relative;
    z-index: 2;
}
.lr-tabs a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--lr-muted);
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.lr-tabs a:hover {
    background: var(--lr-tint);
    color: var(--lr-green-dark);
}
.lr-tabs a[aria-current="page"] {
    background: var(--lr-green);
    color: #fff;
    box-shadow: 0 8px 16px -8px rgba(8, 116, 84, 0.7);
}

/* Info Alert */
.info-alert {
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--lr-green);
    border-radius: 14px;
    padding: 1.1rem 1.35rem;
    margin: 1.75rem 0 1.5rem;
    box-shadow: 0 1px 2px rgba(24, 53, 45, 0.05);
}
.info-alert h5 {
    color: var(--lr-green-dark);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-alert ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--lr-ink);
    font-size: 0.92rem;
}
.info-alert ul li {
    margin-bottom: 0.35rem;
}
.info-alert ul li::marker {
    color: var(--lr-green);
}
.info-alert strong {
    color: var(--lr-green-dark);
}
.info-alert a {
    color: var(--lr-green);
    font-weight: 600;
}

/* Form Card */
.form-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(24, 53, 45, 0.04), 0 10px 26px -20px rgba(24, 53, 45, 0.35);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.form-card h4 {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--lr-ink);
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}
.form-card h4 > .bi {
    color: var(--lr-green);
}
.lr-num {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lr-tint);
    color: var(--lr-green);
    font-size: 0.95rem;
    font-weight: 800;
}

/* Form Elements */
.form-label {
    font-weight: 600;
    color: var(--lr-ink);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}
.form-label .required {
    color: var(--primary-red);
}
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem 0.875rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--lr-green);
    box-shadow: 0 0 0 3px rgba(8, 116, 84, 0.15);
}
.form-control::placeholder {
    color: #8aa198;
}
.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--primary-red);
    background-color: #fef2f2;
}
.form-control.is-valid, .form-select.is-valid {
    border-color: var(--primary-green);
    background-color: #f0fdf4;
}

/* Buttons */
.btn-submit,
.btn-primary-dark {
    background: var(--lr-green);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 20px -12px rgba(8, 116, 84, 0.9);
    transition: background 0.2s, transform 0.2s;
}
.btn-primary-dark {
    padding: 0.75rem 1.5rem;
}
.btn-submit:hover, .btn-submit:focus,
.btn-primary-dark:hover, .btn-primary-dark:focus {
    background: var(--lr-green-dark);
    color: #fff;
    transform: translateY(-1px);
}
.btn-submit:disabled {
    background: #8fb3a6;
    color: #fff;
    box-shadow: none;
    transform: none;
}
.btn-reset {
    background: #fff;
    color: var(--lr-muted);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}
.btn-reset:hover {
    background: var(--lr-tint);
    color: var(--lr-green-dark);
}

/* Footer */
.footer-main {
    background: linear-gradient(180deg, #064e3b 0%, #053b2d 100%);
    color: #fff;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-main h5 {
    color: #fbbf24;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.footer-main ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-main ul li {
    margin-bottom: 0.5rem;
}
.footer-main ul li a {
    color: #c5ddd3;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-main ul li a:hover {
    color: #fff;
}
.footer-contact p {
    color: #c5ddd3;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-contact i {
    color: #34d399;
}
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}
.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s;
}
.footer-social a:hover {
    background: var(--lr-green-light);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    color: #9fbfb2;
    font-size: 0.85rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}
.footer-brand-text {
    font-size: 0.85rem;
    color: #c5ddd3;
    line-height: 1.5;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    color: #fff;
}

/* Tarjeta de confirmación / resultado */
.success-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(24, 53, 45, 0.04), 0 18px 40px -26px rgba(24, 53, 45, 0.45);
    padding: 2.5rem;
    text-align: center;
    max-width: 640px;
    margin: 2rem auto;
}
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--lr-tint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.success-icon i {
    font-size: 2.5rem;
    color: var(--lr-green);
}
.success-card h2 {
    color: var(--lr-ink);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.order-number {
    background: linear-gradient(135deg, #064e3b 0%, #0d9668 100%);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin: 1rem 0;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}
.lr-datos {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    margin: 1rem 0;
    font-size: 0.92rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.lr-datos th, .lr-datos td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0.85rem;
    vertical-align: top;
}
.lr-datos tr:last-child th, .lr-datos tr:last-child td {
    border-bottom: none;
}
.lr-datos th {
    background: #f5f8f6;
    color: var(--lr-muted);
    font-weight: 600;
    width: 42%;
}
.lr-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* Estado del reclamo */
.lr-badge-estado {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}
.lr-stepper {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 1rem;
}
.lr-stepper li {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 0.82rem;
    color: #8aa198;
    font-weight: 600;
}
.lr-stepper li::before {
    content: '';
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 0.4rem;
    border-radius: 50%;
    border: 3px solid #c9d9d0;
    background: #fff;
    position: relative;
    z-index: 1;
}
.lr-stepper li + li::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 50%;
    width: 100%;
    height: 3px;
    background: #c9d9d0;
}
.lr-stepper li.hecho, .lr-stepper li.actual {
    color: var(--lr-green-dark);
}
.lr-stepper li.hecho::before {
    background: var(--lr-green);
    border-color: var(--lr-green);
}
.lr-stepper li.actual::before {
    border-color: var(--lr-green);
    box-shadow: 0 0 0 4px rgba(8, 116, 84, 0.15);
}
.lr-stepper li.hecho + li::after {
    background: var(--lr-green);
}
.lr-respuesta {
    background: #f5f8f6;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--lr-green);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    text-align: left;
    white-space: pre-line;
    font-size: 0.93rem;
}

/* Campo trampa para bots (no visible para personas) */
.lr-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 767.98px) {
    .lr-hero {
        padding: 1.5rem 0 3.5rem;
        text-align: center;
    }
    .lr-hero-grid {
        flex-direction: column;
        gap: 1.1rem;
    }
    .lr-hero-libro {
        border-radius: 18px;
        padding: 10px 12px;
    }
    .lr-hero-libro img {
        width: 180px;
    }
    .lr-hero h1 {
        margin-top: 0.6rem;
    }
    .lr-hero-lead {
        margin-left: auto;
        margin-right: auto;
        font-size: 0.92rem;
    }
    .form-card {
        padding: 1.25rem;
    }
    .success-card {
        padding: 1.5rem 1.1rem;
    }
    .order-number {
        font-size: 1.15rem;
        padding: 0.8rem 1.1rem;
    }
    .btn-submit, .btn-reset {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .lr-tabs {
        margin-left: 16px;
        margin-right: 16px;
    }
    .lr-tabs a {
        font-size: 0.86rem;
        padding: 0.7rem 0.4rem;
    }
    .lr-datos th {
        width: 45%;
    }
}

/* ───────── Formulario de registro ───────── */
/* ===== NUEVO SISTEMA DE VALIDACIÓN - SHAKE & GLOW ===== */
.field-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

/* Estado de error con shake */
.field-wrapper.has-error .form-control,
.field-wrapper.has-error .form-select {
    border: 2px solid var(--primary-red);
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    animation: fieldShake 0.5s ease;
}

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Tooltip de error flotante */
.error-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.error-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #b91c1c;
}
.error-tooltip i {
    font-size: 1rem;
}

.field-wrapper.has-error .error-tooltip {
    opacity: 1;
    visibility: visible;
    animation: tooltipBounce 0.4s ease;
}

@keyframes tooltipBounce {
    0% { transform: translateX(-50%) translateY(10px); opacity: 0; }
    50% { transform: translateX(-50%) translateY(-5px); }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Indicador de campo requerido mejorado */
.required-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-red);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
}

/* Barra de progreso del formulario */
.form-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), #10b981);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Modal de errores flotante */
.validation-modal {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    padding: 0;
    max-width: 380px;
    z-index: 1001;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.validation-modal.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
.validation-modal-header {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.validation-modal-header i {
    font-size: 1.5rem;
}
.validation-modal-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.validation-modal-header span {
    font-size: 0.85rem;
    opacity: 0.9;
}
.validation-modal-close {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.validation-modal-close:hover {
    background: rgba(255,255,255,0.3);
}
.validation-modal-body {
    padding: 16px 20px;
    max-height: 250px;
    overflow-y: auto;
}
.validation-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef4f1;
    cursor: pointer;
    transition: background 0.2s;
}
.validation-modal-item:last-child {
    border-bottom: none;
}
.validation-modal-item:hover {
    background: #fef2f2;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}
.validation-modal-item .item-icon {
    width: 36px;
    height: 36px;
    background: #fee2e2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    flex-shrink: 0;
}
.validation-modal-item .item-text {
    flex: 1;
}
.validation-modal-item .item-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--lr-ink);
}
.validation-modal-item .item-text span {
    font-size: 0.8rem;
    color: var(--lr-muted);
}

/* ===== DNI VERIFICATION - DIGIT BOX DESIGN ===== */
.dni-section {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(8, 116, 84, 0.08);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.dni-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--lr-green-deep), var(--lr-green), var(--lr-green-light), #34d399);
    background-size: 300% 100%;
}
.dni-section.loading::before {
    animation: shimmer 2s infinite linear;
}
.dni-section.verified {
    border-color: var(--primary-green);
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.15);
}
.dni-section.verified::before {
    background: var(--primary-green);
}
.dni-section.error-state {
    border-color: var(--primary-red);
}
.dni-section.error-state::before {
    background: var(--primary-red);
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.dni-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.dni-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dni-title-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--lr-green-deep), var(--lr-green-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}
.dni-section.verified .dni-title-icon {
    background: linear-gradient(135deg, var(--primary-green), #10b981);
}
.dni-title h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.dni-title span {
    font-size: 0.85rem;
    color: var(--lr-muted);
    font-weight: 400;
}
.dni-status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dni-status-badge.pending {
    background: #eef4f1;
    color: var(--lr-muted);
}
.dni-status-badge.verified {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}
.dni-status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Digit Boxes Container */
.dni-digits-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.dni-digit-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.dni-digit-box {
    width: 48px;
    height: 60px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #f5f8f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    transition: all 0.2s ease;
    position: relative;
}
.dni-digit-box.active {
    border-color: var(--primary-dark);
    background: white;
    box-shadow: 0 0 0 4px rgba(8, 116, 84, 0.1);
    transform: scale(1.05);
}
.dni-digit-box.active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 28px;
    background: var(--primary-dark);
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.dni-digit-box.filled {
    border-color: var(--primary-dark);
    background: white;
}
.dni-section.verified .dni-digit-box.filled {
    border-color: var(--primary-green);
    background: #ecfdf5;
    color: var(--primary-green);
}
.dni-section.error-state .dni-digit-box.filled {
    border-color: var(--primary-red);
    background: #fef2f2;
    color: var(--primary-red);
}

/* Hidden real input */
.dni-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Verify Button */
.dni-verify-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--border-color), #c9d9d0);
    color: var(--lr-muted);
}
.dni-verify-btn.ready {
    background: linear-gradient(135deg, var(--lr-green), var(--lr-green-deep));
    color: white;
    box-shadow: 0 4px 15px rgba(8, 116, 84, 0.3);
}
.dni-verify-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(8, 116, 84, 0.4);
}
.dni-verify-btn.loading {
    background: linear-gradient(135deg, var(--lr-muted), #8aa198);
    color: white;
    pointer-events: none;
}
.dni-verify-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.dni-verify-btn .btn-icon {
    font-size: 1.2rem;
}

/* Result Card */
.dni-result-card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 16px;
    display: none;
    animation: fadeSlideUp 0.5s ease;
}
.dni-result-card.show {
    display: flex;
    align-items: center;
    gap: 16px;
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.dni-result-card.success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #6ee7b7;
}
.dni-result-card.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fca5a5;
}
.result-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.dni-result-card.success .result-avatar {
    background: var(--primary-green);
    color: white;
}
.dni-result-card.error .result-avatar {
    background: var(--primary-red);
    color: white;
}
.result-info h6 {
    margin: 0 0 4px;
    font-size: 0.85rem;
    font-weight: 500;
}
.dni-result-card.success .result-info h6 { color: #065f46; }
.dni-result-card.error .result-info h6 { color: #991b1b; }
.result-info p {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.dni-result-card.success .result-info p { color: #047857; }
.dni-result-card.error .result-info p { color: #b91c1c; }

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary-green), #10b981);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    animation: popIn 0.4s ease;
}
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.verified-field {
    background-color: #ecfdf5 !important;
    border-color: var(--primary-green) !important;
}

/* Field Status Indicators */
.field-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 20px;
    padding-left: 2px;
}
.field-status.valid { color: var(--primary-green); }
.field-status.invalid { color: var(--primary-red); }
.field-status.typing { color: #f59e0b; }

/* Mobile Responsive */
@media (max-width: 576px) {
    /* Las 8 cajas se reparten el ancho disponible: con ancho fijo desbordaban en 320-430 px */
    .dni-digit-boxes {
        gap: 4px;
        width: 100%;
    }
    .dni-digit-box {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: 44px;
        height: 48px;
        font-size: 1.3rem;
        border-radius: 10px;
    }
    .dni-digit-box.active {
        transform: none;
    }
    .dni-section {
        padding: 1.25rem 0.85rem;
    }
    .dni-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Tooltip de ayuda */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--border-color);
    color: var(--lr-muted);
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: help;
    margin-left: 6px;
}
.help-tip:hover {
    background: var(--primary-dark);
    color: white;
}

/* Radio Cards */
.radio-card {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.radio-card:hover {
    border-color: #8aa198;
}
.radio-card.selected {
    border-color: var(--primary-dark);
    background: var(--lr-tint);
}
.radio-card input[type="radio"] {
    margin-right: 0.5rem;
}
.radio-card .radio-title {
    font-weight: 600;
    color: var(--primary-dark);
}
.radio-card .radio-desc {
    font-size: 0.85rem;
    color: var(--lr-muted);
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}
.char-counter.warning {
    color: #f59e0b;
}
.char-counter.danger {
    color: var(--primary-red);
}

/* Checkbox Custom */
.form-check-custom {
    background: #f5f8f6;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    margin-bottom: 0.75rem;
}
.form-check-custom .form-check-input {
    margin-left: -1.5rem;
}
.form-check-custom .form-check-label {
    font-size: 0.9rem;
    color: var(--lr-ink);
}

/* Nombre: bloqueado hasta verificar el DNI; editable si RENIEC no responde */
.nombre-bloqueado {
    background-color: #f5f8f6;
    cursor: not-allowed;
}
.nombre-manual-aviso {
    display: none;
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.85rem;
}
.nombre-manual-aviso.show {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.dni-manual-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--lr-green);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

/* Aviso informativo con la paleta del portal (reemplaza al cian de Bootstrap) */
.lr-aviso {
    background: var(--lr-tint);
    border: 1px solid #cfe6da;
    color: var(--lr-ink);
    border-radius: 12px;
}
.lr-aviso .bi {
    color: var(--lr-green);
}

/* Ancho de lectura cómodo, alineado con el hero */
.lr-main {
    max-width: 1000px;
}
.lr-main a:not(.btn) {
    color: var(--lr-green);
    font-weight: 600;
}
.lr-main a:not(.btn):hover {
    color: var(--lr-green-dark);
}
