/* ================================================
   CASAS ASTROLOGICAS - APP STYLES
   ================================================ */

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

    position: relative;
    overflow: hidden;
}

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

.cst-fase {
    animation: cstFadeIn 0.6s ease;
}

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

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

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

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

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

.cst-destello::before { content: '\2726'; }

.cst-d1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.cst-d2 { animation-delay: -1.5s; top: -5px; right: 15px; }

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

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

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

.cst-form-campos {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.cst-campo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
    width: 100%;
}

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

.cst-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(--cst-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;
}

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

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

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

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

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

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

.cst-instruccion a:hover {
    color: var(--cst-violeta);
}

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

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

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

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

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

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

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

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

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

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

.cst-asc-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.cst-asc-signo {
    font-size: 3rem;
}

.cst-asc-info {
    text-align: left;
}

.cst-asc-titulo {
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.cst-asc-elemento {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    text-transform: capitalize;
}

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

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

.cst-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);
}

.cst-elem-compat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cst-elem-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.cst-elem-badge {
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
}

.cst-elem-num {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.cst-sintesis-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
    text-align: center;
}

/* Houses grid */
.cst-casas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cst-casa-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 1.2rem;
    animation: cstSlideIn 0.5s ease both;
    transition: var(--cst-transicion);
}

.cst-casa-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

.cst-casa-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.cst-casa-num {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cst-casa-romano {
    font-size: 0.85rem;
    font-weight: 700;
}

.cst-casa-titulo h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.cst-casa-signo {
    font-size: 0.85rem;
    font-weight: 500;
}

.cst-casa-mensaje {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.cst-casa-consejo {
    background: rgba(139, 92, 246, 0.08);
    border-left: 2px solid var(--cst-violeta);
    padding: 0.6rem 0.8rem;
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-style: italic;
}

/* Boton nueva consulta */
.cst-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(--cst-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

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

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

.cst-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(167, 139, 250, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    animation: cstFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .cst-titulo { font-size: 1.6rem; }
    .cst-icono-oraculo { font-size: 3rem; }
    .cst-seccion { padding: 1.5rem; }
    .cst-asc-signo { font-size: 2.5rem; }
}

@media (max-width: 480px) {
    .cst-form-contenido { padding: 1.5rem 0.5rem; }
    .cst-titulo { font-size: 1.4rem; }
    .cst-subtitulo { font-size: 0.85rem; }
    .cst-casas-grid { grid-template-columns: 1fr; }
    .cst-seccion { padding: 1.2rem; }
    .cst-asc-display { flex-direction: column; text-align: center; }
    .cst-asc-info { text-align: center; }
    .cst-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .cst-btn-calcular { padding: 0.9rem 2rem; font-size: 1rem; }
    .cst-casa-consejo { border-left: none; border-top: 2px solid var(--cst-violeta); border-radius: 8px 8px 0 0; }
}

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

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

@media (prefers-contrast: high) {
    .cst-seccion { border: 2px solid rgba(255, 255, 255, 0.5); }
    .cst-casa-card { border: 2px solid rgba(255, 255, 255, 0.4); }
}

@media print {
    .cst-app::before { display: none; }
    .cst-btn-nueva { display: none; }
    .cst-btn-calcular { display: none; }
    .cst-seccion { break-inside: avoid; }
    .cst-casas-grid { grid-template-columns: 1fr; }
}