/* Academia Ateneo: limpio, oscuro y claro. Prefijo at- */
:root {
  --bg: #04101f; --bg2: #071a30; --card: #0a1d36; --line: #16345a;
  --fg: #eaf4ff; --muted: #9db3cc; --accent: #2ee6d6; --accent2: #1e6be6; --on-accent: #04101f;
  --danger: #ff7a8a; --ok: #2ee6a6; --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --font-title: 'Sora', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg2: #f3f7fc; --card: #ffffff; --line: #d5e0ee;
  --fg: #0b1b3a; --muted: #51647f; --accent: #08857b; --accent2: #1e6be6; --on-accent: #ffffff;
  --danger: #c0334a; --ok: #0a7d56; --shadow: 0 18px 50px rgba(11, 27, 58, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.at-wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.only-dark { display: block; } .only-light { display: none; }
:root[data-theme="light"] .only-dark { display: none; }
:root[data-theme="light"] .only-light { display: block; }
.at-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Botones */
.at-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.at-btn:active { transform: translateY(1px); }
.at-btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent2)); background-origin: border-box; border-color: transparent; color: var(--on-accent); }
.at-btn-primary:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.at-btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.at-btn-ghost:hover { background: var(--bg2); }
.at-btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.at-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Cabecera */
.at-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.at-header .at-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.at-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.at-brand .mark { height: 34px; width: auto; }
.at-brand .name { height: 26px; width: auto; }
.at-nav { display: flex; align-items: center; gap: 8px; }
.at-nav a.at-link { text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.at-nav a.at-link:hover { color: var(--fg); }
.at-theme { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; }
.at-theme:hover { background: var(--bg2); }
.at-theme svg { width: 20px; height: 20px; }
.at-theme .sun { display: none; } :root[data-theme="light"] .at-theme .sun { display: block; } :root[data-theme="light"] .at-theme .moon { display: none; }
.at-user { color: var(--muted); font-size: .92rem; }

/* Hero */
.at-hero { position: relative; overflow: hidden; padding: 64px 0 56px; text-align: center; }
.at-hero::before { content: ''; position: absolute; inset: -40% -10% auto -10%; height: 90%; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; }
.at-hero .lockup { width: min(420px, 78%); height: auto; margin: 0 auto 28px; }
.at-hero h1 { position: relative; font-family: var(--font-title); font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em; }
.at-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.at-hero p { position: relative; color: var(--muted); max-width: 560px; margin: 0 auto 26px; font-size: 1.08rem; }
.at-hero .actions { position: relative; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Secciones */
.at-section { padding: 40px 0; }
.at-section h2 { font-family: var(--font-title); font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.01em; }
.at-section .sub { color: var(--muted); margin: 0 0 22px; }

/* Tarjetas de curso */
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.at-card { display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; padding: 0; transition: transform .2s, border-color .2s, box-shadow .2s; }
.at-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.at-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, var(--card)), color-mix(in srgb, var(--accent2) 30%, var(--card))); display: grid; place-items: center; overflow: hidden; }
.at-cover img { width: 100%; height: 100%; object-fit: cover; }
.at-cover .ph { width: 38%; height: auto; opacity: .55; }
.at-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.at-card h3 { font-family: var(--font-title); font-size: 1.08rem; line-height: 1.3; margin: 0; }
.at-card p { color: var(--muted); font-size: .94rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.at-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; font-size: .88rem; color: var(--muted); }
.at-price { font-weight: 700; color: var(--fg); }
.at-chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.at-chip.own { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.at-empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }

/* Codigo */
.at-code { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.at-code h2 { font-size: 1.15rem; margin: 0 0 2px; }
.at-code p { margin: 0; color: var(--muted); }
.at-code form { display: flex; gap: 10px; flex: 1 1 320px; max-width: 460px; }
.at-input { width: 100%; min-height: 44px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.at-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.at-code .at-input { text-transform: uppercase; letter-spacing: .08em; }

/* Dialogos */
dialog.at-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
dialog.at-dialog::backdrop { background: rgba(2, 8, 20, .62); backdrop-filter: blur(3px); }
.at-dlg-body { padding: 24px; position: relative; }
.at-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 1.2rem; line-height: 1; }
.at-close:hover { background: var(--bg2); }
.at-dlg-cover { aspect-ratio: 16 / 7; margin: -24px -24px 18px; border-radius: 20px 20px 0 0; }
.at-dlg-body h3 { font-family: var(--font-title); font-size: 1.35rem; margin: 0 0 8px; padding-right: 36px; }
.at-dlg-body .desc p { margin: 0 0 10px; color: var(--muted); }
.at-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.at-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.at-buy .big { font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; }
.at-buy .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.at-linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Formulario de acceso */
.at-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 12px; margin: 6px 0 18px; }
.at-tabs button { min-height: 38px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.at-tabs button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.at-form { display: grid; gap: 12px; }
.at-form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.at-form .err { color: var(--danger); font-size: .92rem; min-height: 1.2em; }
.at-hide { display: none !important; }
.at-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; margin: 4px 0 0; border-radius: 12px; border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font-weight: 600; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.at-google:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.at-google:active { transform: translateY(1px); }
.at-google[disabled] { opacity: .6; cursor: wait; }
.at-google svg { width: 20px; height: 20px; flex: 0 0 auto; }
.at-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--muted); font-size: .85rem; }
.at-or::before, .at-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Casillas de autorizacion de datos (registro, ventana de autorizacion y preferencias) */
.at-form label.at-check, label.at-check { display: flex; gap: 9px; align-items: flex-start; font-size: .78rem; line-height: 1.45; color: var(--muted); text-align: left; cursor: pointer; }
label.at-check input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
label.at-check a, .at-legal a { color: var(--accent); text-decoration: underline; }
.at-legal { margin: 8px 0 0; font-size: .74rem; line-height: 1.45; color: var(--muted); text-align: center; }
dialog.at-consent.at-dialog { width: min(440px, calc(100% - 20px)); border-radius: 18px; }
.at-consent .at-dlg-body { padding: 20px; }
.at-consent h3 { font-size: 1.1rem; padding-right: 0; }
.at-consent p { margin: 0 0 12px; font-size: .86rem; color: var(--muted); }
.at-consent .at-btn { min-height: 42px; font-size: .92rem; }
.at-consent .at-linkbtn { font-size: .8rem; justify-self: center; }
@media (max-width: 560px) { dialog.at-consent.at-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; max-height: 92dvh; } .at-consent .at-dlg-body { padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); } }

/* Aviso */
.at-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60; max-width: calc(100% - 32px); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow); transition: opacity .25s, transform .25s; pointer-events: none; }
.at-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Pie */
.at-footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 36px; color: var(--muted); font-size: .9rem; text-align: center; }
.at-footer a { color: var(--accent); text-decoration: none; }

/* Mis cursos / progreso */
[hidden] { display: none !important; }
.at-h1 { font-family: var(--font-title); font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 6px; letter-spacing: -.01em; }
.at-card-static { cursor: default; }
.at-card-static:hover { transform: none; border-color: var(--line); box-shadow: none; }
.at-progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.at-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }
.at-card-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.at-spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: at-spin .8s linear infinite; }
@keyframes at-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .at-nav > .at-user, .at-nav > a.at-link { display: none; }
  .at-brand .name { height: 22px; }
  .at-hero { padding: 40px 0 36px; }
  .at-code form { max-width: none; }
}
/* Menu hamburguesa (celular y tablet). Lo arma at-core.js moviendo los enlaces de .at-nav a .at-menu. */
.at-menu { display: contents; }
.at-burger { display: none; position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; flex: 0 0 auto; }
.at-burger:hover { background: var(--bg2); }
.at-burger span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--fg); transition: transform .25s, opacity .2s, top .25s; }
.at-burger span:nth-child(1) { top: 13px; }
.at-burger span:nth-child(2) { top: 19px; }
.at-burger span:nth-child(3) { top: 25px; }
.menu-open .at-burger span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-open .at-burger span:nth-child(2) { opacity: 0; }
.menu-open .at-burger span:nth-child(3) { top: 19px; transform: rotate(-45deg); }
@media (max-width: 860px) {
  .at-burger { display: block; }
  .at-nav .at-menu { display: none; position: absolute; top: calc(100% + 6px); right: 12px; width: min(300px, calc(100vw - 24px)); flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 30; }
  .at-nav.menu-open .at-menu { display: flex; animation: at-menu-in .18s ease-out; }
  .at-menu a.at-link { display: block; padding: 12px 14px; border-radius: 10px; color: var(--fg); font-size: .95rem; }
  .at-menu a.at-link:hover, .at-menu a.at-link:focus-visible { background: var(--bg2); }
  .at-menu .at-user { order: -1; display: block; padding: 8px 14px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--fg); }
}
@keyframes at-menu-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
