/* ================================================
   SIGNO LUNAR - APP STYLES
   ================================================ */

.sl-app {
    --sl-luna: #8b5cf6;
    --sl-luna-oscuro: #7c3aed;
    --sol: #fbbf24;
    --sl-gradiente: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
    --sl-gradiente-luna: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    --sl-gradiente-sol: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --sl-sombra: 0 10px 30px rgba(139, 92, 246, 0.15);
    --sl-sombra-hover: 0 15px 40px rgba(139, 92, 246, 0.25);
    --sl-radio: 16px;
    --sl-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

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

.sl-fase {
    animation: slFadeIn 0.6s ease;
}

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

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

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

@keyframes slBrillar {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3) drop-shadow(0 0 15px rgba(139, 92, 246, 0.5)); }
}

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

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

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

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

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

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

.sl-form-campos {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.sl-campo {
    text-align: left;
}

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

.sl-select {
    width: 100%;
    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;
    transition: var(--sl-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 1rem center;
    cursor: pointer;
}

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

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

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

.sl-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

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

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

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

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

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

@keyframes slLunaPulso {
    0%, 100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4)); }
    50% { transform: translate(-50%, -50%) scale(1.15); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.7)); }
}

.sl-orbita-arc {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 80px;
    height: 80px;
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: slArcGiro 8s linear infinite;
}

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

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

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

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

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

.sl-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.sl-fecha-nac {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.sl-natal-info {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.sl-solar-badge {
    color: var(--sol);
    font-weight: 600;
}

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

.sl-seccion:nth-child(1) { animation-delay: 0s; }
.sl-seccion:nth-child(2) { animation-delay: 0.1s; }
.sl-seccion:nth-child(3) { animation-delay: 0.15s; }
.sl-seccion:nth-child(4) { animation-delay: 0.2s; }
.sl-seccion:nth-child(5) { animation-delay: 0.25s; }
.sl-seccion:nth-child(6) { animation-delay: 0.3s; }

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

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

.sl-titulo-luna { color: var(--sl-luna); }
.sl-titulo-elem { color: #10b981; }
.sl-titulo-fase { color: #94a3b8; }
.sl-titulo-instinto { color: var(--sol); }
.sl-titulo-compat { color: #ec4899; }

/* Card: Sign display */
.sl-card-signo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.sl-card-simbolo {
    font-size: 3.5rem;
    min-width: 60px;
    text-align: center;
}

.sl-card-info {
    flex: 1;
}

.sl-card-nombre {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
}

.sl-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sl-meta-item {
    font-size: 0.85rem;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.sl-elem-fuego { color: #f87171; background: rgba(239, 68, 68, 0.15); }
.sl-elem-tierra { color: #4ade80; background: rgba(34, 197, 94, 0.15); }
.sl-elem-agua { color: #60a5fa; background: rgba(59, 130, 246, 0.15); }
.sl-elem-aire { color: #c084fc; background: rgba(168, 85, 247, 0.15); }

.sl-meta-sep {
    color: rgba(255, 255, 255, 0.3);
}

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

.sl-subtitulo {
    color: var(--sl-luna);
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}

.sl-rasgos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.sl-rasgo-badge {
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--sl-luna);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.sl-rasgo-luna {
    background: rgba(139, 92, 246, 0.12);
    color: var(--sl-luna);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Element card */
.sl-elem-display {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.sl-elem-icono {
    font-size: 3rem;
    min-width: 50px;
    text-align: center;
}

.sl-elem-info {
    flex: 1;
}

.sl-elem-nombre {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.sl-elem-signos {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Moon Phase Visual */
.sl-fase-visual {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.sl-moon-sphere {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffd700, #e0e0e0 60%, #999);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.sl-moon-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #1a1a2e;
    transition: all 0.3s ease;
}

.sl-fase-nueva .sl-moon-shadow { left: 0; width: 80px; opacity: 0.95; }
.sl-fase-creciente .sl-moon-shadow { left: 30px; width: 50px; border-radius: 50%; }
.sl-fase-llena .sl-moon-shadow { display: none; }
.sl-fase-menguante .sl-moon-shadow { left: -30px; width: 50px; border-radius: 50%; }

.sl-fase-info {
    flex: 1;
}

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

.sl-fase-energia {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

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

.sl-card-consejo::before { content: '\1F4A1  '; }

/* Instinct & Shadow */
.sl-instinto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sl-instinto-item {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.sl-sombra-item {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
}

.sl-instinto-label {
    color: var(--sol);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.sl-sombra-item .sl-instinto-label {
    color: #f87171;
}

.sl-instinto-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Compatibility */
.sl-compat-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.sl-compat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
}

.sl-compat-simbolo {
    font-size: 1.2rem;
}

.sl-compat-nombre {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Overall advice */
.sl-consejo-general {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--sl-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: slSlideIn 0.6s ease both;
}

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

/* New consultation button */
.sl-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(--sl-transicion);
    font-family: inherit;
}

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

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

.sl-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(102, 126, 234, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(251, 191, 36, 0.03) 0%, transparent 50%);
    animation: slFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .sl-titulo-form { font-size: 1.6rem; }
    .sl-icono-oraculo { font-size: 3rem; }
    .sl-form-campos { grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }
    .sl-card-signo { gap: 0.8rem; }
    .sl-card-simbolo { font-size: 2.8rem; min-width: 50px; }
    .sl-card-nombre { font-size: 1.2rem; }
    .sl-instinto-grid { grid-template-columns: 1fr; }
    .sl-fase-visual { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .sl-form-contenido { padding: 1.5rem 0.5rem; }
    .sl-titulo-form { font-size: 1.4rem; }
    .sl-subtitulo-form { font-size: 0.85rem; }
    .sl-form-campos { grid-template-columns: 1fr; }
    .sl-resultado-contenido { padding: 1.5rem 0.5rem; }
    .sl-card-simbolo { font-size: 2.5rem; }
    .sl-seccion { padding: 1.2rem; }
    .sl-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .sl-btn-calcular { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    .sl-instinto-grid { grid-template-columns: 1fr; }
    .sl-compat-grid { flex-direction: column; }
    .sl-moon-sphere { width: 60px; height: 60px; }
    .sl-moon-shadow { width: 60px; height: 60px; }
    .sl-fase-creciente .sl-moon-shadow { left: 22px; width: 38px; }
    .sl-fase-menguante .sl-moon-shadow { left: -22px; width: 38px; }
    .sl-elem-icono { font-size: 2.5rem; }
}

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

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

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

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