/* ================================================
   NUMEROLOGIA KARMICA - APP STYLES
   ================================================ */

.nk-app {
    --nk-violeta: #8b5cf6;
    --nk-violeta-oscuro: #7c3aed;
    --nk-dorado: #d4af37;
    --nk-gradiente: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #8b5cf6 100%);
    --nk-gradiente-dorado: linear-gradient(135deg, #d4af37 0%, #8b5cf6 50%, #d4af37 100%);
    --nk-sombra: 0 10px 30px rgba(139, 92, 246, 0.15);
    --nk-sombra-hover: 0 15px 40px rgba(139, 92, 246, 0.25);
    --nk-radio: 16px;
    --nk-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

/* ================================================
   FASE FORMULARIO
   ================================================ */

.nk-fase {
    animation: nkFadeIn 0.6s ease;
}

@keyframes nkFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nk-form-contenido {
    text-align: center;
    padding: 2.5rem 1rem;
}

.nk-icono-oraculo {
    font-size: 4rem;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: nkBrillar 3s ease-in-out infinite;
}

@keyframes nkBrillar {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); }
}

.nk-destello {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: nkDestello 3s ease-in-out infinite;
    pointer-events: none;
}

.nk-destello::before { content: '\2726'; }
.nk-d2::before { content: '\2756'; }
.nk-d3::before { content: '\2727'; }

.nk-d1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.nk-d2 { animation-delay: -1.5s; top: -5px; right: 15px; }
.nk-d3 { animation-delay: -2.5s; bottom: 5px; left: 25px; }

@keyframes nkDestello {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.8; transform: translateY(-20px) scale(1); }
}

.nk-titulo {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--nk-gradiente);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nk-subtitulo {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.nk-form-campos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

.nk-campo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nk-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-align: left;
}

.nk-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--nk-transicion);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nk-select:focus {
    outline: none;
    border-color: var(--nk-violeta);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

.nk-select option {
    background: #1a1a2e;
    color: #fff;
}

.nk-btn-calcular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--nk-gradiente);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--nk-transicion);
    font-family: inherit;
    box-shadow: var(--nk-sombra);
    margin-bottom: 1rem;
}

.nk-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: var(--nk-sombra-hover);
}

.nk-btn-calcular:active {
    transform: translateY(0);
}

.nk-instruccion {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ================================================
   LOADING
   ================================================ */

.nk-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.nk-loading-orbe {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--nk-gradiente);
    animation: nkPulsoOrbe 2s ease-in-out infinite;
    margin-bottom: 1.5rem;
    position: relative;
}

.nk-loading-orbe::after {
    content: '\2726';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #fff;
}

@keyframes nkPulsoOrbe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(139, 92, 246, 0.3); }
    50% { transform: scale(1.15); box-shadow: 0 0 50px rgba(139, 92, 246, 0.5); }
}

.nk-loading-texto {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    animation: nkPulso 1.5s ease-in-out infinite;
}

@keyframes nkPulso {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================
   FASE RESULTADO
   ================================================ */

.nk-resultado-contenido {
    padding: 2rem 1rem;
}

.nk-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
}

.nk-resultado-titulo {
    font-size: 1.8rem;
    background: var(--nk-gradiente);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.nk-resultado-fecha {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.nk-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--nk-radio);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: nkSlideIn 0.6s ease both;
}

@keyframes nkSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nk-seccion-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.nk-seccion-icono {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    flex-shrink: 0;
}

.nk-seccion-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.nk-numero-badge {
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    display: inline-block;
}

.nk-seccion-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.nk-seccion-consejo {
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid var(--nk-violeta);
    padding: 1rem 1.2rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-style: italic;
}

.nk-seccion-titulo {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* Deudas karmicas */
.nk-deuda-card {
    background: rgba(220, 20, 60, 0.05);
    border: 1px solid rgba(220, 20, 60, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.nk-deuda-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nk-deuda-numero {
    font-size: 1.5rem;
    font-weight: 700;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.nk-badge-13 { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.nk-badge-14 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.nk-badge-16 { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.nk-badge-19 { background: rgba(16, 185, 129, 0.2); color: #4ade80; }

.nk-badge-13 + div .nk-deuda-badge { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

.nk-deuda-header h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.nk-deuda-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}

.nk-deuda-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.nk-deuda-consejo {
    background: rgba(220, 20, 60, 0.08);
    border-left: 3px solid #dc143c;
    padding: 0.8rem 1rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-style: italic;
}

.nk-sin-deuda {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-size: 0.95rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

/* Numeros ausentes */
.nk-ausente-intro {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.nk-ausente-card {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.nk-ausente-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.nk-ausente-numero {
    font-size: 1.3rem;
    font-weight: 700;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 10px;
    color: #ffd700;
    flex-shrink: 0;
}

.nk-ausente-header h4 {
    color: #fff;
    font-size: 1rem;
}

.nk-ausente-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.nk-ausente-consejo {
    background: rgba(212, 175, 55, 0.08);
    border-left: 3px solid var(--nk-dorado);
    padding: 0.8rem 1rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-style: italic;
}

/* Boton nueva consulta */
.nk-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--nk-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.nk-btn-nueva:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--nk-violeta);
    transform: translateY(-2px);
}

/* ================================================
   PARTICULAS DE FONDO
   ================================================ */

.nk-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    animation: nkFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes nkFondo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nk-fase { position: relative; z-index: 1; }
.nk-loading { position: relative; z-index: 1; }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .nk-titulo { font-size: 1.6rem; }
    .nk-icono-oraculo { font-size: 3rem; }
    .nk-seccion { padding: 1.5rem; }
    .nk-seccion-icono { width: 60px; height: 60px; font-size: 2.5rem; }
    .nk-deuda-numero { width: 45px; height: 45px; font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .nk-form-contenido { padding: 1.5rem 0.5rem; }
    .nk-titulo { font-size: 1.4rem; }
    .nk-subtitulo { font-size: 0.85rem; }
    .nk-form-campos { grid-template-columns: 1fr; max-width: 280px; }
    .nk-select { padding: 0.7rem; }
    .nk-seccion { padding: 1.2rem; }
    .nk-seccion-header { flex-direction: column; text-align: center; }
    .nk-seccion-icono { width: 55px; height: 55px; font-size: 2rem; }
    .nk-deuda-header { flex-direction: column; text-align: center; }
    .nk-deuda-numero { width: 45px; height: 45px; }
    .nk-ausente-header { flex-direction: column; text-align: center; }
    .nk-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .nk-btn-calcular { padding: 0.9rem 2rem; font-size: 1rem; }
}

/* ================================================
   ACCESIBILIDAD
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .nk-app::before { animation: none; }
    .nk-icono-oraculo { animation: none; }
    .nk-destello { animation: none; display: none; }
    .nk-loading-orbe { animation: none; }
    .nk-loading-texto { animation: none; opacity: 1; }
    .nk-seccion { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .nk-seccion { border: 2px solid rgba(255, 255, 255, 0.5); }
    .nk-deuda-card { border: 2px solid rgba(255, 255, 255, 0.3); }
    .nk-ausente-card { border: 2px solid rgba(255, 255, 255, 0.3); }
}

@media print {
    .nk-app::before { display: none; }
    .nk-btn-nueva { display: none; }
    .nk-btn-calcular { display: none; }
    .nk-seccion { break-inside: avoid; }
}