/* ================================================
   ORACULO DE MENSAJES - APP STYLES
   ================================================ */

.msj-app {
    --msj-oro: #fdcb6e;
    --msj-dorado: #f7971e;
    --msj-purpura: #9c88ff;
    --msj-rosa: #fd79a8;
    --msj-azul: #74b9ff;
    --msj-gradiente: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 50%, #1a1a2e 100%);
    --msj-gradiente-dorado: linear-gradient(135deg, #f7971e 0%, #fdcb6e 50%, #ffd200 100%);
    --msj-gradiente-divino: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --msj-sombra: 0 10px 30px rgba(156, 136, 255, 0.3);
    --msj-radio: 16px;
    --msj-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

.msj-fase {
    animation: msjFadeIn 0.6s ease;
}

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

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

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

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

@keyframes msjPulso {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3) drop-shadow(0 0 20px rgba(253, 203, 110, 0.5)); }
}

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

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

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

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

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

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

.msj-form-campo {
    max-width: 500px;
    margin: 0 auto 1rem;
    text-align: left;
    position: relative;
}

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

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

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

.msj-input:focus,
.msj-select:focus,
.msj-textarea:focus {
    outline: none;
    border-color: var(--msj-oro);
    box-shadow: 0 0 0 3px rgba(253, 203, 110, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

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

.msj-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.msj-contador {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.msj-select {
    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='%23fdcb6e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

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

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

.msj-btn-recibir:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.3);
}

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

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

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

.msj-loading-pergamino {
    width: 100px;
    height: 100px;
    position: relative;
    margin-bottom: 1.5rem;
}

.msj-pergamino-exterior {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(253, 203, 110, 0.2);
    border-radius: 12px;
    animation: msjGiro 6s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(253, 203, 110, 0.03);
}

.msj-pergamino-interior {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 76px;
    height: 76px;
    border: 2px dashed rgba(253, 203, 110, 0.15);
    border-radius: 8px;
    animation: msjGiroInverso 8s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msj-pergamino-centro {
    font-size: 2.5rem;
    animation: msjPulsoCentro 2s ease-in-out infinite;
}

@keyframes msjPulsoCentro {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.3) drop-shadow(0 0 15px rgba(253, 203, 110, 0.5)); }
}

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

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

.msj-loading-arcos {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

.msj-arco {
    position: absolute;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: msjArcoPulso 2.5s ease-out infinite;
}

.msj-arco-1 {
    top: -8px; left: -8px;
    width: 116px; height: 116px;
    border-top-color: rgba(253, 203, 110, 0.4);
    animation-delay: 0s;
}

.msj-arco-2 {
    top: -14px; left: -14px;
    width: 128px; height: 128px;
    border-right-color: rgba(156, 136, 255, 0.35);
    animation-delay: -0.8s;
}

.msj-arco-3 {
    top: -20px; left: -20px;
    width: 140px; height: 140px;
    border-bottom-color: rgba(253, 121, 168, 0.3);
    animation-delay: -1.6s;
}

@keyframes msjArcoPulso {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

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

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

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

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

.msj-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(253, 203, 110, 0.1);
    border-radius: var(--msj-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: msjSlideIn 0.6s ease both;
}

.msj-seccion:nth-child(2) { animation-delay: 0s; }
.msj-seccion:nth-child(3) { animation-delay: 0.08s; }
.msj-seccion:nth-child(4) { animation-delay: 0.15s; }
.msj-seccion:nth-child(5) { animation-delay: 0.2s; }
.msj-seccion:nth-child(6) { animation-delay: 0.25s; }

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

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

/* ================================================
   TIPO DE MENSAJE
   ================================================ */

.msj-tipo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.msj-tipo-icono {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.msj-tipo-icono::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.3;
    animation: msjAnilloPulso 2s ease-in-out infinite;
}

@keyframes msjAnilloPulso {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.08); opacity: 0.1; }
}

.msj-tipo-info {
    flex: 1;
    min-width: 140px;
}

.msj-tipo-nombre {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.msj-tipo-temas {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3rem;
}

.msj-resonancia {
    text-align: center;
    flex-shrink: 0;
}

.msj-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.4rem;
    background: rgba(253, 203, 110, 0.03);
}

.msj-score-num {
    font-size: 1.8rem;
    font-weight: 800;
}

.msj-score-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.msj-tipo-desc {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ================================================
   MENSAJE DIVINO
   ================================================ */

.msj-mensaje-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.msj-mensaje-icono {
    font-size: 1.5rem;
}

.msj-mensaje-titulo {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.msj-mensaje-texto {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 0.97rem;
    margin-bottom: 0;
    font-style: italic;
}

/* ================================================
   REFLEXION
   ================================================ */

.msj-reflexion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(253, 203, 110, 0.06);
    border: 1px solid rgba(253, 203, 110, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

.msj-reflexion-icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--msj-oro);
}

.msj-reflexion-text {
    color: rgba(255, 255, 255, 0.87);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ================================================
   ACCION
   ================================================ */

.msj-accion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(156, 136, 255, 0.06);
    border: 1px solid rgba(156, 136, 255, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

.msj-accion-icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--msj-purpura);
}

.msj-accion-text {
    color: rgba(255, 255, 255, 0.87);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ================================================
   AFIRMACION
   ================================================ */

.msj-afirmacion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(253, 121, 168, 0.06);
    border: 1px solid rgba(253, 121, 168, 0.15);
    border-radius: 12px;
    padding: 1rem;
}

.msj-afirmacion-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--msj-rosa);
}

.msj-afirmacion-text {
    color: rgba(255, 255, 255, 0.87);
    font-size: 0.93rem;
    line-height: 1.6;
    font-style: italic;
}

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

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

.msj-btn-nuevo:hover {
    background: rgba(253, 203, 110, 0.15);
    border-color: var(--msj-oro);
    transform: translateY(-2px);
}

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

.msj-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(26, 26, 46, 0.8) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(45, 27, 78, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(253, 203, 110, 0.03) 0%, transparent 50%);
    animation: msjFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .msj-titulo-form { font-size: 1.6rem; }
    .msj-icono-oraculo { font-size: 3rem; }
    .msj-tipo-header { flex-direction: column; text-align: center; }
    .msj-resonancia { margin-top: 0.5rem; }
}

@media (max-width: 480px) {
    .msj-form-contenido { padding: 1.5rem 0.5rem; }
    .msj-titulo-form { font-size: 1.4rem; }
    .msj-subtitulo-form { font-size: 0.85rem; }
    .msj-resultado-contenido { padding: 1.5rem 0.5rem; }
    .msj-seccion { padding: 1.2rem; }
    .msj-btn-nuevo { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .msj-btn-recibir { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    .msj-score-circle { width: 65px; height: 65px; }
    .msj-score-num { font-size: 1.4rem; }
}

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

@media (prefers-reduced-motion: reduce) {
    .msj-app::before { animation: none; }
    .msj-icono-oraculo { animation: none; }
    .msj-destello { animation: none; display: none; }
    .msj-pergamino-exterior,
    .msj-pergamino-interior,
    .msj-pergamino-centro,
    .msj-arco { animation: none; }
    .msj-loading-texto { animation: none; opacity: 1; }
    .msj-seccion { animation: none; opacity: 1; transform: none; }
    .msj-tipo-icono::after { animation: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

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

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