/* ==========================================================================
   Portal de clientes y Cursos — complementa styles.css
   ========================================================================== */
body.page-portal, body.page-cursos { background: var(--mist); }
.page-portal .nav, .page-cursos .nav { background: rgba(255, 255, 255, .96); }
.footer--slim { padding: 26px var(--pad); text-align: center; }
.footer--slim .footer__legal { margin: 0 auto; }
.footer--slim a { color: var(--gold-soft); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; display: inline-block; vertical-align: -4px; margin-right: 10px; }

/* ---------- Ingreso ---------- */
.portal { min-height: calc(100vh - 80px); padding-top: var(--nav-h); }
.login {
  max-width: 1080px; margin: clamp(30px, 6vw, 70px) auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 1fr 1fr; border-radius: 26px; overflow: hidden;
  box-shadow: 0 50px 100px -60px rgba(16, 30, 64, .5);
}
.login[hidden], .dash[hidden] { display: none; }
.login__side { background: var(--navy); color: rgba(255, 255, 255, .8); padding: clamp(36px, 5vw, 60px); position: relative; overflow: hidden; }
.login__side::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(228, 207, 158, .3); }
.login__logo { width: 190px; height: auto; margin-bottom: 46px; }
.login__title { font-family: var(--f-display); font-size: clamp(34px, 3.6vw, 48px); line-height: 1.05; color: #fff; margin-bottom: 30px; }
.login__title em { color: var(--gold-soft); }
.login__list li { position: relative; padding: 12px 0 12px 28px; border-top: 1px solid rgba(255, 255, 255, .1); }
.login__list li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 6px; height: 11px; border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.login__main { background: #fff; padding: clamp(36px, 5vw, 60px); display: flex; align-items: center; }
.login__form { width: 100%; }
.login__form h2 { font-family: var(--f-display); font-size: 36px; color: var(--navy); margin-bottom: 6px; }
.login__hint { color: var(--muted); margin-bottom: 28px; }
.login__help { margin: 20px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.login__help a { color: var(--navy); font-weight: 600; border-bottom: 1px solid var(--gold); }
.pass { position: relative; }
.pass input { padding-right: 84px; }
.pass__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--mist); color: var(--navy); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.login .form__error { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #fbeeec; }
button[disabled] { opacity: .65; cursor: wait; }

/* ---------- Panel ---------- */
.dash { max-width: var(--max); margin: 0 auto; padding: clamp(36px, 5vw, 60px) var(--pad) 80px; }
.dash__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.dash__head .eyebrow { margin-bottom: 12px; }
.dash__title { font-family: var(--f-display); font-size: clamp(36px, 4vw, 54px); color: var(--navy); line-height: 1.05; }
.dash__rut { margin: 6px 0 0; color: var(--muted); letter-spacing: .04em; }

.folders { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.folders[hidden], .files[hidden] { display: none; }
.folder {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 30px 26px; border-radius: 22px; border: 1px solid var(--line); background: #fff;
  font: inherit; color: var(--ink); cursor: pointer;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .45s var(--ease-out);
}
.folder:hover { transform: translateY(-6px); border-color: var(--gold-soft); box-shadow: 0 36px 60px -40px rgba(16, 30, 64, .4); }
.folder__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--navy); margin-bottom: 14px; transition: background .4s; }
.folder__icon svg { width: 26px; height: 26px; fill: var(--gold-soft); }
.folder:hover .folder__icon { background: var(--gold); }
.folder:hover .folder__icon svg { fill: var(--navy); }
.folder b { font-family: var(--f-display); font-size: 26px; color: var(--navy); }
.folder small { font-size: 14px; color: var(--muted); line-height: 1.4; }

.files { background: #fff; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.crumbs button { border: 0; background: none; padding: 0; font: inherit; color: var(--navy); font-weight: 600; cursor: pointer; border-bottom: 1px solid var(--gold-soft); }
.crumbs b { color: var(--ink); }
.file {
  width: 100%; display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 16px;
  padding: 14px 24px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer; transition: background .25s;
}
.file:last-child { border-bottom: 0; }
.file:hover { background: #f8f9fc; }
.file__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--mist); }
.file__icon svg { width: 22px; height: 22px; fill: var(--navy); }
.file__icon--carpeta { background: rgba(196, 158, 82, .16); }
.file__icon--carpeta svg { fill: var(--gold); }
.file__icon--pdf svg { fill: #b4483c; }
.file__name { font-weight: 600; word-break: break-word; }
.file__meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.file__go { font-size: 13px; font-weight: 700; color: var(--navy); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); transition: background .25s, color .25s; }
.file:hover .file__go { background: var(--navy); color: #fff; border-color: var(--navy); }
.file.is-loading { opacity: .6; pointer-events: none; }
.files__state { padding: 60px 24px; text-align: center; color: var(--muted); }
.files__state small { font-size: 14px; }
.files__state--error { color: #b4483c; }

/* ---------- Visor ---------- */
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(11, 22, 48, .94); display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(16px, 3vw, 30px); color: #fff; }
.viewer__bar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__actions { display: flex; align-items: center; gap: 12px; flex: none; }
.viewer__actions .btn { min-height: 42px; padding: 0 20px; }
.viewer__close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: none; color: #fff; font-size: 18px; cursor: pointer; }
.viewer__body { flex: 1; display: grid; place-items: center; padding: 0 clamp(10px, 3vw, 30px) clamp(10px, 3vw, 30px); min-height: 0; }
.viewer__body iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.viewer__body img, .viewer__body video { max-width: 100%; max-height: 100%; border-radius: 12px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95; padding: 14px 22px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14.5px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

/* ---------- Cursos ---------- */
.c-hero { padding: calc(var(--nav-h) + clamp(50px, 7vw, 90px)) var(--pad) clamp(40px, 5vw, 60px); background: #fff; border-bottom: 1px solid var(--line); }
.c-hero__inner { max-width: var(--max); margin: 0 auto; }
.c-hero__title { font-family: var(--f-display); font-size: clamp(42px, 5.6vw, 76px); line-height: 1.02; color: var(--navy); max-width: 16ch; }
.c-hero__title em { color: var(--navy-3); }
.c-list { padding-top: clamp(50px, 6vw, 80px); }
.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.c-card { display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
.c-card:hover { transform: translateY(-6px); box-shadow: 0 40px 70px -45px rgba(16, 30, 64, .45); }
.c-card__media { aspect-ratio: 16 / 10; background: var(--navy); overflow: hidden; }
.c-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.c-card:hover .c-card__media img { transform: scale(1.04); }
.c-card__ph { display: grid; place-items: center; height: 100%; font-family: var(--f-display); font-size: 90px; color: var(--gold-soft); }
.c-card__body { display: flex; flex-direction: column; flex: 1; padding: 28px; }
.c-card__tag { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.c-card h3 { font-family: var(--f-display); font-size: 30px; line-height: 1.1; color: var(--navy); margin-bottom: 12px; }
.c-card__desc { color: var(--muted); font-size: 15.5px; flex: 1; }
.c-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.c-card__price { margin: 0; font-size: 28px; font-weight: 700; color: var(--navy); }
.c-card__foot .btn { min-height: 46px; padding: 0 22px; }
.c-card__ask { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--navy); align-self: flex-start; border-bottom: 1px solid var(--gold); }
.c-state { grid-column: 1 / -1; padding: 60px 24px; text-align: center; color: var(--muted); background: #fff; border-radius: 22px; border: 1px solid var(--line); }
.c-state b { display: block; font-family: var(--f-display); font-size: 30px; color: var(--navy); margin-bottom: 8px; }
.c-state .btn { margin-top: 12px; }

.c-steps { margin-top: clamp(60px, 8vw, 100px); padding: clamp(32px, 5vw, 56px); border-radius: 26px; background: var(--navy); color: rgba(255, 255, 255, .78); }
.c-steps__title { font-family: var(--f-display); font-size: clamp(30px, 3vw, 42px); color: #fff; margin-bottom: 28px; }
.c-steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-bottom: 34px; }
.c-steps li { display: grid; grid-template-columns: 46px 1fr; gap: 14px; }
.c-steps li span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-soft); font-family: var(--f-display); font-size: 22px; }
.c-steps b { color: #fff; font-size: 17px; }
.c-steps p { margin: 4px 0 0; font-size: 15px; }
.c-steps .btn--line { border-color: var(--gold-soft); color: #fff; }
.c-steps .btn--line:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .folders { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; margin-top: 20px; }
  .login__side { padding-bottom: 36px; }
  .login__logo { width: 150px; margin-bottom: 28px; }
  .login__list { display: none; }
  .c-steps ol { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login { padding: 0; margin: 0; border-radius: 0; }
  .folders { grid-template-columns: 1fr; }
  .folder { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; padding: 22px; }
  .folder__icon { margin: 0; }
  .folder small { flex-basis: 100%; }
  .file { grid-template-columns: 40px 1fr; padding: 14px 16px; row-gap: 2px; }
  .file__icon { grid-row: span 2; width: 40px; height: 40px; }
  .file__meta { grid-column: 2; }
  .file__go { display: none; }
  .c-grid { grid-template-columns: 1fr; }
  .viewer__actions .btn { padding: 0 14px; font-size: 14px; }
}
