/* ================================================
   BIORRITMOS - APP STYLES
   ================================================ */

.bio-app {
    --bio-cyan: #06b6d4;
    --bio-cyan-oscuro: #0891b2;
    --bio-gradiente: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #06b6d4 100%);
    --bio-sombra: 0 10px 30px rgba(6, 182, 212, 0.15);
    --bio-sombra-hover: 0 15px 40px rgba(6, 182, 212, 0.25);
    --bio-radio: 16px;
    --bio-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bio-fisico: #ef4444;
    --bio-emocional: #10b981;
    --bio-intelectual: #8b5cf6;

    position: relative;
    overflow: hidden;
}

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

.bio-fase {
    animation: bioFadeIn 0.6s ease;
}

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

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

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

@keyframes bioOndular {
    0%, 100% { transform: scale(1) translateY(0); filter: brightness(1); }
    50% { transform: scale(1.1) translateY(-5px); filter: brightness(1.3); }
}

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

.bio-destello::before { content: '\223F'; }

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

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

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

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

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

.bio-campo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.bio-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--bio-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='%2306b6d4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.bio-select:focus {
    outline: none;
    border-color: var(--bio-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

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

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

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

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

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

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

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

.bio-loading-ondas {
    width: 120px;
    height: 70px;
    position: relative;
    margin-bottom: 1.5rem;
}

.bio-onda {
    position: absolute;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    animation: bioOndaFlujo 2s ease-in-out infinite;
}

.bio-onda-fisica {
    top: 10px;
    background: var(--bio-fisico);
    animation-duration: 2.3s;
}

.bio-onda-emocional {
    top: 33px;
    background: var(--bio-emocional);
    animation-duration: 2.8s;
}

.bio-onda-intelectual {
    top: 56px;
    background: var(--bio-intelectual);
    animation-duration: 3.3s;
}

@keyframes bioOndaFlujo {
    0%, 100% { transform: scaleX(0.6); opacity: 0.5; }
    50% { transform: scaleX(1.2); opacity: 1; }
}

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

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

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

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

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

.bio-fecha-nac {
    color: var(--bio-cyan);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.bio-dias-vivo {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.bio-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: var(--bio-radio);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: bioSlideIn 0.6s ease both;
}

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

.bio-seccion:nth-child(3) { animation-delay: 0.1s; }
.bio-seccion:nth-child(4) { animation-delay: 0.2s; }
.bio-seccion:nth-child(5) { animation-delay: 0.3s; }

/* General assessment */
.bio-general-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.bio-general-icono {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(6, 182, 212, 0.12);
    color: var(--bio-cyan);
    flex-shrink: 0;
}

.bio-general-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.bio-general-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.bio-general-consejo {
    background: rgba(6, 182, 212, 0.08);
    border-left: 3px solid var(--bio-cyan);
    padding: 1rem 1.2rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-style: italic;
}

/* Cycle cards */
.bio-ciclo-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.bio-ciclo-icono {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    flex-shrink: 0;
}

.bio-ciclo-fisico { background: rgba(239, 68, 68, 0.12); }
.bio-ciclo-emocional { background: rgba(16, 185, 129, 0.12); }
.bio-ciclo-intelectual { background: rgba(139, 92, 246, 0.12); }

.bio-ciclo-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.bio-ciclo-duracion {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.bio-ciclo-valor {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.bio-ciclo-num {
    font-size: 2.2rem;
    font-weight: 700;
}

.bio-fase-badge {
    font-size: 0.75rem;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
}

.bio-fase-alta { background: rgba(16, 185, 129, 0.2); color: #4ade80; }
.bio-fase-baja { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.bio-fase-critica { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* Progress bar */
.bio-barra {
    margin-bottom: 1.5rem;
}

.bio-barra-fondo {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.bio-barra-centro {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.bio-barra-relleno {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease, left 0.8s ease;
    z-index: 1;
}

.bio-barra-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

.bio-ciclo-titulo {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bio-ciclo-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.bio-ciclo-consejo {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 1.2rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-style: italic;
}

/* Boton nueva consulta */
.bio-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(6, 182, 212, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--bio-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.bio-btn-nueva:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--bio-cyan);
    transform: translateY(-2px);
}

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

.bio-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(8, 145, 178, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    animation: bioFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .bio-titulo { font-size: 1.6rem; }
    .bio-icono-oraculo { font-size: 3rem; }
    .bio-seccion { padding: 1.5rem; }
    .bio-general-icono,
    .bio-ciclo-icono { width: 50px; height: 50px; font-size: 1.8rem; }
    .bio-ciclo-num { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .bio-form-contenido { padding: 1.5rem 0.5rem; }
    .bio-titulo { font-size: 1.4rem; }
    .bio-subtitulo { font-size: 0.85rem; }
    .bio-form-campos { grid-template-columns: 1fr; gap: 0.8rem; max-width: none; }
    .bio-seccion { padding: 1.2rem; }
    .bio-general-header,
    .bio-ciclo-header { flex-direction: column; text-align: center; }
    .bio-general-icono,
    .bio-ciclo-icono { width: 50px; height: 50px; font-size: 1.5rem; }
    .bio-ciclo-valor { justify-content: center; }
    .bio-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .bio-btn-calcular { padding: 0.9rem 2rem; font-size: 1rem; }
    .bio-ciclo-consejo { border-left: none; border-top: 3px solid rgba(255, 255, 255, 0.2); border-radius: 10px 10px 0 0; }
    .bio-general-consejo { border-left: none; border-top: 3px solid var(--bio-cyan); border-radius: 10px 10px 0 0; }
}

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

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

@media (prefers-contrast: high) {
    .bio-seccion { border: 2px solid rgba(255, 255, 255, 0.5); }
    .bio-barra-fondo { background: rgba(255, 255, 255, 0.2); }
}

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