/**
 * IDC RUC Validator — Estilos Frontend
 * Botón con spinner neón futurista + checkmark/X animados.
 * Sin mensajes de texto, puro feedback visual.
 *
 * @package IDC_Operations_Hub
 * @since   2.5.0
 */

/* ═══════════════════════════════════════════════════
 *  Botón "Validar" — Estado base
 * ═══════════════════════════════════════════════════ */
.idc-validate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    min-width: 140px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #001d81 0%, #0038d1 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 29, 129, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 24px;
}

.idc-validate-btn:hover {
    background: linear-gradient(135deg, #0038d1 0%, #0050ff 100%);
    box-shadow: 0 4px 20px rgba(0, 56, 209, 0.45);
    transform: translateY(-1px);
}

.idc-validate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 29, 129, 0.25);
}

/* ═══════════════════════════════════════════════════
 *  Estructura interna del botón
 * ═══════════════════════════════════════════════════ */
.idc-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.idc-btn-label {
    transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════
 *  Spinner neón futurista
 * ═══════════════════════════════════════════════════ */
.idc-neon-spinner {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    border-top-color: #00f0ff;
    border-right-color: #7c3aed;
    animation: idc-neon-spin 0.65s linear infinite;
    box-shadow:
        0 0 8px rgba(0, 240, 255, 0.4),
        0 0 16px rgba(124, 58, 237, 0.2),
        inset 0 0 6px rgba(0, 240, 255, 0.15);
}

@keyframes idc-neon-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
 *  Iconos SVG (check ✓ y X ✗)
 * ═══════════════════════════════════════════════════ */
.idc-check-icon,
.idc-x-icon {
    display: none;
    width: 22px;
    height: 22px;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

/* ═══════════════════════════════════════════════════
 *  Estado: LOADING — Spinner neón
 * ═══════════════════════════════════════════════════ */
.idc-validate-btn.idc-btn--loading {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    cursor: not-allowed;
    pointer-events: none;
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.15),
        0 0 30px rgba(124, 58, 237, 0.1);
    min-width: 56px;
    padding: 0 16px;
}

.idc-btn--loading .idc-neon-spinner {
    display: inline-block;
}

.idc-btn--loading .idc-btn-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════
 *  Estado: SUCCESS — Checkmark verde neón
 * ═══════════════════════════════════════════════════ */
.idc-validate-btn.idc-btn--success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow:
        0 0 12px rgba(16, 185, 129, 0.4),
        0 0 24px rgba(5, 150, 105, 0.15);
    pointer-events: none;
    min-width: 56px;
    padding: 0 16px;
}

.idc-btn--success .idc-check-icon {
    display: inline-block;
    stroke: #ffffff;
    stroke-dashoffset: 0;
    animation: idc-draw-check 0.4s ease forwards;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.idc-btn--success .idc-btn-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

@keyframes idc-draw-check {
    0%   { stroke-dashoffset: 50; opacity: 0; }
    30%  { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

/* ═══════════════════════════════════════════════════
 *  Estado: ERROR — X rojo + shake
 * ═══════════════════════════════════════════════════ */
.idc-validate-btn.idc-btn--error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow:
        0 0 12px rgba(239, 68, 68, 0.4),
        0 0 24px rgba(220, 38, 38, 0.15);
    animation: idc-shake 0.45s ease-in-out;
    pointer-events: none;
    min-width: 56px;
    padding: 0 16px;
}

.idc-btn--error .idc-x-icon {
    display: inline-block;
    stroke: #ffffff;
    stroke-dashoffset: 0;
    animation: idc-draw-check 0.35s ease forwards;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.idc-btn--error .idc-btn-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

@keyframes idc-shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-5px); }
    30%      { transform: translateX(5px); }
    45%      { transform: translateX(-4px); }
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px); }
    90%      { transform: translateX(2px); }
}

/* ═══════════════════════════════════════════════════
 *  Campos auto-completados — pulso verde suave
 * ═══════════════════════════════════════════════════ */
.idc-field-filled {
    animation: idc-fieldGlow 0.7s ease;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes idc-fieldGlow {
    0%   { background-color: #ffffff; }
    40%  { background-color: #ecfdf5; }
    100% { background-color: #ffffff; }
}
