:root {
    --bg: #12051e;
    --bg-soft: #1b0a2b;
    --panel: rgba(41, 20, 59, .78);
    --panel-solid: #2a163b;
    --panel-high: #3a2051;
    --text: #fff8ff;
    --muted: #c9bbd1;
    --primary: #a8adff;
    --primary-strong: #828dff;
    --aqua: #31d6c7;
    --line: rgba(255, 255, 255, .10);
    --danger: #ff91a6;
    --shadow: 0 24px 70px rgba(3, 0, 10, .42);
    --sidebar: 268px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font: 400 16px/1.55 Inter, system-ui, sans-serif; }
body.light-mode {
    --bg: #f7f4fb;
    --bg-soft: #eee9f5;
    --panel: rgba(255, 255, 255, .86);
    --panel-solid: #fff;
    --panel-high: #e9e1f1;
    --text: #251631;
    --muted: #6d6075;
    --line: rgba(45, 25, 58, .12);
    --shadow: 0 24px 60px rgba(62, 39, 79, .13);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, strong { font-family: Arimo, Inter, sans-serif; }

.eyebrow { color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px; color: #171328; background: linear-gradient(135deg, #b6b8ff, #7fd8f1); box-shadow: 0 14px 30px rgba(130, 141, 255, .25); font-weight: 800; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(130, 141, 255, .38); }
.text-button { padding: 0; border: 0; color: var(--primary); background: none; font-size: .82rem; font-weight: 700; cursor: pointer; }
.theme-button, .round-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: var(--panel); backdrop-filter: blur(18px); cursor: pointer; }
.toast { position: fixed; right: 24px; bottom: 28px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: rgba(27, 10, 43, .94); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

/* Authentication */
.auth-body { display: grid; place-items: center; padding: 34px; overflow-x: hidden; }
.auth-background { position: fixed; inset: 0; z-index: -3; background: linear-gradient(100deg, rgba(12, 3, 21, .82), rgba(18, 5, 30, .63)), url('../fondo.jpg') center/cover; }
.ambient { position: fixed; z-index: -2; width: 560px; height: 560px; border-radius: 50%; filter: blur(100px); opacity: .28; }
.ambient-one { top: -230px; left: -180px; background: #34d9c6; }
.ambient-two { right: -160px; bottom: -240px; background: #9367ff; }
.auth-body .theme-button { position: fixed; top: 24px; right: 24px; z-index: 5; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr); width: min(1080px, 100%); min-height: 650px; border: 1px solid rgba(255,255,255,.13); border-radius: 32px; background: rgba(20, 7, 32, .60); box-shadow: var(--shadow); backdrop-filter: blur(34px); overflow: hidden; }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; padding: 54px; background: linear-gradient(145deg, rgba(8, 31, 37, .82), rgba(36, 13, 53, .72)); border-right: 1px solid rgba(255,255,255,.08); }
.brand-link img { width: 230px; }
.auth-story h2 { max-width: 410px; margin: 22px 0 16px; font-size: clamp(2.5rem, 5vw, 4rem); line-height: .98; letter-spacing: -.05em; }
.auth-story p { max-width: 400px; margin: 0; color: #d1c6d7; }
.trust-line { display: flex; align-items: center; gap: 10px; color: #bfb2c8; font-size: .78rem; }
.trust-line span { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 18px var(--aqua); }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 60px clamp(36px, 7vw, 78px); background: rgba(36, 14, 51, .42); }
.form-heading { margin-bottom: 30px; }
.form-heading h1 { margin: 8px 0 5px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; letter-spacing: -.04em; }
.form-heading p { margin: 0; color: #bfb2c8; }
.auth-form { display: grid; gap: 19px; }
.field { display: grid; gap: 8px; }
.field > span, .field > label { color: #ded4e4; font-size: .76rem; font-weight: 700; }
.field input { width: 100%; height: 52px; padding: 0 17px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; outline: 0; color: #fff; background: rgba(7, 3, 13, .32); transition: border .2s, box-shadow .2s; }
.password-field { position: relative; }
.password-field input { padding-right: 58px; }
.password-toggle { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; color: #b8aec1; background: transparent; cursor: pointer; transform: translateY(-50%); transition: color .2s ease, background .2s ease; }
.password-toggle:hover, .password-toggle:focus-visible { color: #fff; background: rgba(168,173,255,.14); outline: none; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(168,173,255,.10); }
.field input::placeholder { color: #887a92; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.check-label { display: flex; align-items: center; gap: 9px; color: #bfb2c8; font-size: .78rem; }
.check-label input { width: 17px; height: 17px; accent-color: var(--primary-strong); }
.terms { align-items: flex-start; }
.switch-copy { margin: 25px 0 0; color: #bfb2c8; font-size: .84rem; text-align: center; }
.switch-copy a { color: var(--primary); font-weight: 800; }
.form-alert { margin: -10px 0 22px; padding: 12px 15px; border: 1px solid rgba(255,145,166,.28); border-radius: 13px; color: #ffd2db; background: rgba(123,32,56,.24); font-size: .82rem; }
.form-alert ul { margin: 0; padding-left: 18px; }

.auth-body.light-mode .auth-background { background: linear-gradient(100deg, rgba(232, 248, 250, .92), rgba(244, 240, 250, .88)), url('../fondo.jpg') center/cover; }
.auth-body.light-mode .ambient { opacity: .16; }
.auth-body.light-mode .auth-shell { border-color: rgba(45, 89, 105, .15); background: rgba(255, 255, 255, .82); }
.auth-body.light-mode .auth-story { border-right-color: rgba(45, 89, 105, .12); background: linear-gradient(145deg, rgba(225, 249, 249, .96), rgba(238, 235, 252, .94)); }
.auth-body.light-mode .auth-story h2 { color: #123c49; }
.auth-body.light-mode .auth-story p,
.auth-body.light-mode .trust-line,
.auth-body.light-mode .form-heading p,
.auth-body.light-mode .check-label,
.auth-body.light-mode .switch-copy { color: #536b74; }
.auth-body.light-mode .auth-form-panel { background: rgba(255, 255, 255, .88); }
.auth-body.light-mode .field > span,
.auth-body.light-mode .field > label { color: #173d49; }
.auth-body.light-mode .field input { border-color: rgba(25, 88, 106, .2); color: #123744; background: #fff; }
.auth-body.light-mode .field input::placeholder { color: #82949b; }
.auth-body.light-mode .password-toggle { color: #456b76; }
.auth-body.light-mode .password-toggle:hover,
.auth-body.light-mode .password-toggle:focus-visible { color: #073d4d; background: rgba(70, 190, 210, .14); }
.auth-body.light-mode .theme-button { color: #103e4c; background: rgba(255, 255, 255, .94); }
.auth-body.light-mode .form-alert { color: #8b3042; background: #fff0f3; }
/* App shell */
.app-body { background: radial-gradient(circle at 90% 0, #2b1742 0, var(--bg) 42%); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: var(--sidebar); padding: 30px 22px 24px; border-right: 1px solid var(--line); background: rgba(32, 12, 48, .91); backdrop-filter: blur(26px); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.sidebar-logo img { width: 188px; }
.sidebar-close { display: none; border: 0; color: white; background: none; font-size: 2rem; }
.main-nav { display: grid; gap: 7px; margin-top: 34px; }
.main-nav a, .main-nav button, .sidebar-footer button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 15px; border: 0; border-radius: 14px; color: #c7b8d1; background: none; text-align: left; cursor: pointer; transition: .2s; }
.main-nav a span, .main-nav button span, .sidebar-footer span { width: 24px; color: var(--primary); font-size: 1.25rem; text-align: center; }
.main-nav a:hover, .main-nav button:hover, .main-nav a.active { color: #fff; background: rgba(168,173,255,.13); }
.main-nav a.active { box-shadow: inset 3px 0 0 var(--primary); }
.sidebar-program { margin-top: auto; padding: 20px; border: 1px solid rgba(168,173,255,.18); border-radius: 20px; background: linear-gradient(145deg, rgba(168,173,255,.13), rgba(49,214,199,.06)); }
.sidebar-program strong { display: block; margin: 7px 0 3px; }
.sidebar-program p { margin: 0 0 14px; color: #b9a9c5; font-size: .77rem; }
.sidebar-program a { color: var(--aqua); font-size: .78rem; font-weight: 800; }
.sidebar-footer { display: grid; gap: 4px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-footer form { margin: 0; }
[data-install-app] { display: none !important; }
.topbar { position: fixed; inset: 0 0 auto var(--sidebar); z-index: 40; display: flex; align-items: center; justify-content: space-between; height: 82px; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(18,5,30,.72); backdrop-filter: blur(24px); }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.topbar-left small { display: block; color: var(--muted); font-size: .7rem; }
.topbar-left strong { display: block; font-size: 1.05rem; }
.menu-button { display: none; border: 0; color: var(--text); background: none; font-size: 1.35rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(49,214,199,.34); border-radius: 50%; color: #082524; background: linear-gradient(145deg, var(--aqua), #a9fff2); font-weight: 900; }
.app-main { min-height: 100vh; margin-left: var(--sidebar); padding: 112px 36px 110px; }
.hero-card { position: relative; display: flex; align-items: center; min-height: min(480px, 58vh); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.hero-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,5,30,.96) 0%, rgba(18,5,30,.76) 45%, rgba(18,5,30,.08) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 650px; padding: clamp(34px, 7vw, 78px); }
.pill { display: inline-block; padding: 7px 12px; border: 1px solid rgba(168,173,255,.25); border-radius: 999px; background: rgba(168,173,255,.10); }
.hero-content h1 { margin: 20px 0; font-size: clamp(3rem, 7vw, 6.2rem); line-height: .87; letter-spacing: -.07em; }
.hero-content h1.dashboard-hero-title { font-size: clamp(2rem, 4.25vw, 4.4rem); line-height: 1.08; }
.hero-content h1 em { color: var(--primary); font-style: normal; }
.hero-content p { max-width: 540px; margin: 0 0 30px; color: #d8cce0; font-size: 1.02rem; }
.hero-button { width: fit-content; }
.daily-grid { display: grid; grid-template-columns: 1.7fr .75fr; gap: 22px; margin-top: 22px; }
.daily-card { min-height: 240px; padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 15px 42px rgba(3,0,10,.18); }
.daily-focus { display: flex; align-items: center; justify-content: space-between; gap: 28px; background: linear-gradient(130deg, rgba(38,26,72,.9), rgba(18,69,72,.52)); }
.daily-focus > div:first-child { max-width: 610px; }
.daily-card h2 { margin: 12px 0 9px; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.08; }
.daily-card p { margin: 0; color: var(--muted); }
.breathing-orb { flex: 0 0 150px; display: grid; place-items: center; width: 150px; height: 150px; border: 1px solid rgba(49,214,199,.35); border-radius: 50%; background: radial-gradient(circle, rgba(49,214,199,.34), rgba(49,214,199,.02) 65%); box-shadow: 0 0 44px rgba(49,214,199,.15); animation: breathe 7s ease-in-out infinite; }
.breathing-orb span { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
@keyframes breathe { 50% { transform: scale(1.09); box-shadow: 0 0 65px rgba(49,214,199,.28); } }
.streak-card strong { display: block; margin: 12px 0 -6px; color: var(--primary); font-size: 5rem; line-height: 1; }
.streak-card h3 { margin: 12px 0 6px; font-size: 1.2rem; }
.content-section { padding-top: 72px; scroll-margin-top: 64px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 5px 0 0; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; letter-spacing: -.04em; }
.section-heading > span { color: var(--muted); font-size: .78rem; }
.category-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 16px; }
.category-card { position: relative; min-height: 330px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; transition: transform .25s, border-color .25s; }
.category-card:hover { transform: translateY(-7px); border-color: var(--category-color); }
.category-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.category-card:hover > img { transform: scale(1.05); }
.category-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12,3,20,.98), rgba(12,3,20,.12) 75%); }
.category-content { position: absolute; inset: auto 0 0; padding: 22px; }
.category-content > span { color: var(--category-color); font: 800 .7rem Arimo, sans-serif; }
.category-content h3 { margin: 7px 0; font-size: 1.25rem; line-height: 1.08; }
.category-content p { min-height: 50px; margin: 0 0 14px; color: #c9bdcf; font-size: .76rem; }
.category-content small { color: var(--category-color); font-weight: 800; }
.audio-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 20px; }
.audio-card { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); overflow: hidden; transition: transform .25s; }
.audio-card:hover { transform: translateY(-5px); }
.audio-cover { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.audio-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.audio-card:hover .audio-cover img { transform: scale(1.04); }
.audio-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15,5,24,.58), transparent 70%); }
.premium-tag { position: absolute; top: 14px; left: 14px; z-index: 2; padding: 5px 9px; border-radius: 999px; color: #271535; background: #e2b8ff; font-size: .63rem; font-weight: 900; text-transform: uppercase; }
.play-button { position: absolute; right: 16px; bottom: 16px; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; padding-left: 3px; border: 0; border-radius: 50%; color: #151026; background: white; font-size: 1.2rem; cursor: pointer; transition: transform .2s; }
.play-button:hover { transform: scale(1.09); }
.audio-copy { padding: 20px; }
.audio-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--primary); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.audio-copy h3 { margin: 9px 0 7px; font-size: 1.18rem; }
.audio-copy p { min-height: 43px; margin: 0 0 13px; color: var(--muted); font-size: .78rem; }
.audio-copy small { color: var(--muted); font-size: .68rem; }
.empty-state { grid-column: 1/-1; padding: 40px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); text-align: center; }
.mobile-nav { display: none; }
.mobile-overlay { display: none; }
.mini-player { position: fixed; right: 30px; bottom: 24px; z-index: 70; display: grid; grid-template-columns: 54px minmax(150px, 1fr) auto 34px; align-items: center; gap: 13px; width: min(610px, calc(100vw - 60px)); padding: 10px; border: 1px solid rgba(168,173,255,.25); border-radius: 18px; background: rgba(30,12,45,.94); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.mini-player[hidden] { display: none; }
.mini-player img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.mini-player small { display: block; color: var(--primary); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.mini-player strong { display: block; overflow: hidden; font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.player-note { color: #b9a9c5; font-size: .7rem; }
.mini-player button { border: 0; color: white; background: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 1120px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .audio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
    [data-install-app]:not([hidden]) { display: flex !important; }
    .sidebar-logo img { width: 112px; }
    .main-nav { margin-top: 50px; }
    .auth-body { padding: 18px; }
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .auth-story { min-height: 260px; padding: 34px; }
    .auth-story .brand-link img { width: 123px; }
    .auth-story .brand-link { align-self: center; }
    .auth-story .eyebrow { display: block; text-align: center; }
    .login-page .auth-story h2 { display: none; }
    .login-page .auth-story p { display: none; }
    .auth-story h2 { margin: 32px 0 9px; font-size: 2.3rem; }
    .trust-line { display: none; }
    .auth-form-panel { padding: 38px 30px 44px; }
    .sidebar { transform: translateX(-105%); transition: transform .28s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close, .menu-button { display: block; }
    .mobile-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(4,1,8,.62); backdrop-filter: blur(4px); }
    .mobile-overlay.open { display: block; }
    .topbar { left: 0; height: 72px; padding: 0 18px; }
    .app-main { margin-left: 0; padding: 92px 18px 125px; }
    .hero-card { min-height: 510px; }
    .hero-shade { background: linear-gradient(0deg, rgba(18,5,30,.98), rgba(18,5,30,.33)); }
    .hero-content { align-self: flex-end; padding: 30px; }
    .hero-content h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
    .hero-content h1.dashboard-hero-title { font-size: clamp(1.6rem, 3.4vw, 3.52rem); }
    .daily-grid { grid-template-columns: 1fr; }
    .daily-focus { align-items: flex-start; }
    .breathing-orb { flex-basis: 110px; width: 110px; height: 110px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .audio-grid { grid-template-columns: 1fr; }
    .mobile-nav { position: fixed; inset: auto 12px 12px; z-index: 44; display: grid; grid-template-columns: repeat(4,1fr); height: 70px; padding: 7px; border: 1px solid var(--line); border-radius: 21px; background: rgba(32,12,48,.94); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
    .mobile-nav a, .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 14px; color: #bbaec5; background: none; font-size: .58rem; }
    .mobile-nav span { font-size: 1.1rem; }
    .mobile-nav .active { color: var(--primary); background: rgba(168,173,255,.11); }
    .mini-player { right: 12px; bottom: 92px; grid-template-columns: 48px 1fr 30px; width: calc(100vw - 24px); }
    .player-note { display: none; }
}

@media (max-width: 540px) {
    .auth-body { padding: 0; }
    .auth-shell { border: 0; border-radius: 0; }
    .auth-story { min-height: 220px; padding: 28px 24px; }
    .auth-story h2 { font-size: 2rem; }
    .auth-form-panel { padding: 34px 24px 42px; }
    .field-grid { grid-template-columns: 1fr; }
    .form-row { align-items: flex-start; flex-direction: column; }
    .topbar-left small { display: none; }
    .round-button { display: grid; }
    .hero-card { min-height: 500px; }
    .hero-content { padding: 25px; }
    .hero-content h1 { font-size: 2.6rem; }
    .hero-content h1.dashboard-hero-title { font-size: 1.6rem; }
    .daily-focus { flex-direction: column; }
    .breathing-orb { align-self: center; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .category-grid { grid-template-columns: 1fr; }
    .category-card { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
