/* ================================================
   NUMERO DE DESTINO - APP STYLES
   ================================================ */

.nd-app {
    --nd-indigo: #6366f1;
    --nd-indigo-oscuro: #4f46e5;
    --nd-gradiente: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --nd-sombra: 0 10px 30px rgba(99, 102, 241, 0.15);
    --nd-radio: 16px;
    --nd-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

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

.nd-fase {
    animation: ndFadeIn 0.6s ease;
}

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

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

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

@keyframes ndBrillar {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3) drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)); }
}

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

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

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

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

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

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

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

.nd-campo {
    text-align: left;
    flex: 1;
    margin-bottom: 0;
}

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

.nd-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--nd-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='%236366f1' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.nd-select:focus {
    outline: none;
    border-color: var(--nd-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

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

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

.nd-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

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

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

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

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

.nd-orbita-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: var(--nd-gradiente);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    animation: ndPulsoNum 2s ease-in-out infinite;
}

@keyframes ndPulsoNum {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

.nd-orbita-arc {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(99, 102, 241, 0.25);
    border-radius: 50%;
    animation: ndArcGiro 8s linear infinite;
}

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

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

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

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

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

.nd-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.nd-fecha-badge {
    display: inline-block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nd-num-grande {
    margin-bottom: 0.5rem;
}

.nd-num-grande-num {
    display: inline-block;
    font-size: 5rem;
    font-weight: 800;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    text-align: center;
}

.nd-destino-nombre {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.nd-destino-proposito {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.nd-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--nd-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: ndSlideIn 0.6s ease both;
}

.nd-seccion:nth-child(1) { animation-delay: 0s; }
.nd-seccion:nth-child(2) { animation-delay: 0.1s; }
.nd-seccion:nth-child(3) { animation-delay: 0.2s; }
.nd-seccion:nth-child(4) { animation-delay: 0.3s; }

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

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

.nd-titulo-destino { color: var(--nd-indigo); }

.nd-card-desc {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Traits dual */
.nd-rasgos-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.nd-rasgos-col {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
}

.nd-oportunidades {
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.nd-desafios {
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.nd-rasgos-label {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}

.nd-label-op { color: #10b981; }
.nd-label-des { color: #fbbf24; }

.nd-rasgos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nd-rasgo-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 20px;
}

.nd-rasgo-des {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Triada */
.nd-triada-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.nd-triada-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.2rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--nd-transicion);
}

.nd-triada-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.nd-triada-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.nd-triada-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.nd-triada-label {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.nd-triada-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Lecciones */
.nd-lecciones-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.nd-leccion-item {
    background: rgba(99, 102, 241, 0.1);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nd-carrera-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 1rem;
}

.nd-carrera-label {
    color: var(--nd-indigo);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.nd-carrera-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

/* Advice */
.nd-consejo-general {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--nd-radio);
    padding: 1.5rem;
    animation: ndSlideIn 0.6s ease both;
}

.nd-consejo-texto {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
}

/* New consultation button */
.nd-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--nd-transicion);
    font-family: inherit;
}

.nd-btn-nueva:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--nd-indigo);
    transform: translateY(-2px);
}

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

.nd-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(79, 70, 229, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(129, 140, 248, 0.03) 0%, transparent 50%);
    animation: ndFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .nd-titulo-form { font-size: 1.6rem; }
    .nd-icono-oraculo { font-size: 3rem; }
    .nd-form-campos { flex-direction: column; }
    .nd-rasgos-dual { grid-template-columns: 1fr; }
    .nd-triada-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .nd-form-contenido { padding: 1.5rem 0.5rem; }
    .nd-titulo-form { font-size: 1.4rem; }
    .nd-subtitulo-form { font-size: 0.85rem; }
    .nd-resultado-contenido { padding: 1.5rem 0.5rem; }
    .nd-seccion { padding: 1.2rem; }
    .nd-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .nd-btn-calcular { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    .nd-num-grande-num { font-size: 3.5rem; width: 80px; height: 80px; line-height: 80px; }
    .nd-triada-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
    .nd-triada-item { padding: 0.8rem 0.5rem; }
}

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

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

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

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