/* ================================================
   NUMEROS DE LA SOMBRA - APP STYLES
   ================================================ */

.ns-app {
    --ns-purpura: #8360c3;
    --ns-purpura-oscuro: #5b2c87;
    --ns-teal: #2ebf91;
    --ns-gradiente: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
    --ns-sombra: 0 10px 30px rgba(131, 96, 195, 0.15);
    --ns-radio: 16px;
    --ns-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

.ns-fase {
    animation: nsFadeIn 0.6s ease;
}

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

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

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

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

@keyframes nsPulso {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3) drop-shadow(0 0 20px rgba(131, 96, 195, 0.5)); }
}

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

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

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

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

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

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

.ns-form-campo {
    max-width: 500px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.ns-form-seccion {
    margin-bottom: 1.5rem;
}

.ns-seccion-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.ns-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ns-form-campos {
    display: flex;
    gap: 1rem;
    max-width: 450px;
    margin: 0 auto;
    align-items: flex-start;
}

.ns-campo {
    text-align: left;
    flex: 1;
}

.ns-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(131, 96, 195, 0.3);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    transition: var(--ns-transicion);
    box-sizing: border-box;
}

.ns-input:focus {
    outline: none;
    border-color: var(--ns-purpura);
    box-shadow: 0 0 0 3px rgba(131, 96, 195, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

.ns-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.ns-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(131, 96, 195, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--ns-transicion);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238360c3' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.ns-select:focus {
    outline: none;
    border-color: var(--ns-purpura);
    box-shadow: 0 0 0 3px rgba(131, 96, 195, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

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

.ns-btn-calcular {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--ns-gradiente);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ns-transicion);
    margin-top: 1.5rem;
    font-family: inherit;
}

.ns-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(131, 96, 195, 0.3);
}

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

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

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

.ns-loading-orbita {
    width: 90px;
    height: 90px;
    position: relative;
    margin-bottom: 1.5rem;
}

.ns-orbita-centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    animation: nsGiroPulso 2s ease-in-out infinite;
}

@keyframes nsGiroPulso {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(180deg); filter: drop-shadow(0 0 15px rgba(131, 96, 195, 0.6)); }
}

.ns-orbita-arc {
    position: absolute;
    top: 5px; left: 5px;
    width: 80px; height: 80px;
    border: 2px dashed rgba(131, 96, 195, 0.25);
    border-radius: 50%;
    animation: nsArcGiro 8s linear infinite;
}

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

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

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

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

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

.ns-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(131, 96, 195, 0.2);
}

.ns-nombre-badge {
    background: rgba(131, 96, 195, 0.08);
    border: 1px solid rgba(131, 96, 195, 0.2);
    border-radius: 14px;
    padding: 0.8rem 1.5rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.ns-badge-nombre {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
}

.ns-badge-fecha {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.ns-num-principal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ================================================
   LUZ-SOMBRA PAIR
   ================================================ */

.ns-luz-sombra-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.ns-luz-circle, .ns-sombra-circle {
    width: 120px;
    border-radius: 50%;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px solid;
    transition: var(--ns-transicion);
}

.ns-luz-circle {
    background: rgba(255, 255, 255, 0.05);
}

.ns-sombra-circle {
    background: rgba(0, 0, 0, 0.2);
}

.ns-circle-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.ns-circle-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.ns-circle-nombre {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.ns-espejo-linea {
    width: 40px;
    height: 2px;
    background: var(--ns-gradiente);
    flex-shrink: 0;
    opacity: 0.5;
}

.ns-resumen-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.ns-resumen-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
}

/* ================================================
   SECCIONES
   ================================================ */

.ns-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(131, 96, 195, 0.1);
    border-radius: var(--ns-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: nsSlideIn 0.6s ease both;
}

.ns-seccion:nth-child(2) { animation-delay: 0s; }
.ns-seccion:nth-child(3) { animation-delay: 0.1s; }
.ns-seccion:nth-child(4) { animation-delay: 0.15s; }
.ns-seccion:nth-child(5) { animation-delay: 0.2s; }

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

.ns-seccion-titulo {
    color: var(--ns-purpura);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ================================================
   SOMBRA PRINCIPAL
   ================================================ */

.ns-sombra-desc {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.ns-integracion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(46, 191, 145, 0.06);
    border: 1px solid rgba(46, 191, 145, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
}

.ns-integracion-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.ns-integracion-content {
    flex: 1;
}

.ns-integracion-label {
    display: block;
    color: var(--ns-teal);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.ns-integracion-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    line-height: 1.5;
    font-style: italic;
}

.ns-senal-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(196, 69, 105, 0.06);
    border: 1px solid rgba(196, 69, 105, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

.ns-senal-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.ns-senal-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ================================================
   MIEDOS
   ================================================ */

.ns-miedos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.ns-miedo-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    transition: var(--ns-transicion);
}

.ns-miedo-item:hover {
    background: rgba(196, 69, 105, 0.08);
    transform: translateY(-1px);
}

.ns-miedo-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.ns-miedo-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
}

.ns-miedos-nota {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    font-style: italic;
}

/* ================================================
   ESPEJO
   ================================================ */

.ns-espejo-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.ns-espejo-proyeccion, .ns-espejo-verdad {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.2rem;
}

.ns-espejo-label {
    display: block;
    color: var(--ns-purpura);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ns-espejo-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
    line-height: 1.6;
}

.ns-espejo-mirror {
    font-size: 2.5rem;
    opacity: 0.5;
    text-align: center;
}

/* ================================================
   TRES SOMBRAS
   ================================================ */

.ns-sombras-grid {
    display: grid;
    gap: 1rem;
}

.ns-sombra-sub-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.2rem;
    transition: var(--ns-transicion);
}

.ns-sombra-sub-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.ns-sombra-sub-num {
    font-size: 2.5rem;
    font-weight: 800;
    flex-shrink: 0;
    width: 50px;
    text-align: center;
}

.ns-sombra-sub-info {
    flex: 1;
}

.ns-sombra-sub-label {
    display: block;
    color: var(--ns-purpura);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.ns-sombra-sub-nombre {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.ns-sombra-sub-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ================================================
   NUEVA CONSULTA
   ================================================ */

.ns-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(131, 96, 195, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ns-transicion);
    font-family: inherit;
}

.ns-btn-nueva:hover {
    background: rgba(131, 96, 195, 0.15);
    border-color: var(--ns-purpura);
    transform: translateY(-2px);
}

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

.ns-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(131, 96, 195, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(46, 191, 145, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(91, 44, 135, 0.03) 0%, transparent 50%);
    animation: nsFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .ns-titulo-form { font-size: 1.6rem; }
    .ns-icono-oraculo { font-size: 3rem; }
    .ns-form-campos { flex-direction: column; max-width: 280px; margin: 0 auto; }
    .ns-luz-sombra-pair { flex-direction: column; gap: 0.8rem; }
    .ns-espejo-linea { width: 2px; height: 30px; }
    .ns-luz-circle, .ns-sombra-circle { width: 100px; padding: 1rem; }
    .ns-circle-num { font-size: 2rem; }
    .ns-espejo-container { grid-template-columns: 1fr; }
    .ns-espejo-mirror { transform: rotate(90deg); }
    .ns-sombra-sub-item { flex-direction: column; text-align: center; }
    .ns-sombra-sub-num { width: auto; }
}

@media (max-width: 480px) {
    .ns-form-contenido { padding: 1.5rem 0.5rem; }
    .ns-titulo-form { font-size: 1.4rem; }
    .ns-subtitulo-form { font-size: 0.85rem; }
    .ns-resultado-contenido { padding: 1.5rem 0.5rem; }
    .ns-seccion { padding: 1.2rem; }
    .ns-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .ns-btn-calcular { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    .ns-luz-circle, .ns-sombra-circle { width: 80px; padding: 0.8rem 0.5rem; }
    .ns-circle-num { font-size: 1.8rem; }
    .ns-circle-nombre { font-size: 0.72rem; }
    .ns-miedos-grid { grid-template-columns: 1fr; }
}

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

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

@media (prefers-contrast: high) {
    .ns-seccion { border: 2px solid rgba(255, 255, 255, 0.4); }
    .ns-input { border: 2px solid rgba(255, 255, 255, 0.4); }
    .ns-select { border: 2px solid rgba(255, 255, 255, 0.4); }
}

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