/*  JSAG Academy — Client Portal Stylesheet
    Tokens: identical to main site. Layout: sidebar + content, distinct from marketing pages.
    ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Tokens ── */
:root {
  --navy:   #0B1929;
  --navy2:  #0F2236;
  --navy3:  #162D45;
  --gold:   #C8A456;
  --gold2:  #DFC07C;
  --cream:  #F9F6EF;
  --cream2: #EDEAE2;
  --ink:    #1A1A1A;
  --muted:  #5A6B7A;
  --sidebar-w: 270px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--ink); line-height: 1.6; }

a { text-decoration: none; color: inherit; }


/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.academy-sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  border-right: 1px solid rgba(200,164,86,0.12);
}

.sidebar-brand {
  padding: 28px 24px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand img { width: 32px; height: 32px; object-fit: contain; opacity: 0.95; }
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 600;
  color: #fff; letter-spacing: 0.3px;
}
.sidebar-brand-sub {
  font-size: 10px; font-weight: 500;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold); opacity: 0.9;
}

.sidebar-user {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy3);
  border: 1.5px solid rgba(200,164,86,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--gold2);
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-email {
  font-size: 11.5px; color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.user-role {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); opacity: 0.8; margin-top: 1px;
}

.sidebar-nav { flex: 1; padding: 18px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  font-size: 13.5px; font-weight: 400;
  color: rgba(255,255,255,0.6);
  transition: all 0.18s ease;
  border-left: 2px solid transparent;
}
.sidebar-nav a .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav a:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.04); }
.sidebar-nav a.active {
  color: var(--gold2); border-left-color: var(--gold);
  background: rgba(200,164,86,0.07);
}
.sidebar-section-label {
  padding: 14px 24px 6px;
  font-size: 9.5px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.25);
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 10px;
}
.btn-logout {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55); font-size: 12px; font-family: 'DM Sans', sans-serif;
  padding: 9px 16px; border-radius: 5px; cursor: pointer;
  transition: all 0.18s; text-align: left; width: 100%;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-back-link {
  font-size: 11px; color: rgba(255,255,255,0.3);
  transition: color 0.18s;
}
.sidebar-back-link:hover { color: rgba(255,255,255,0.6); }


/* ═══════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════ */
.academy-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--cream);
}

.content-header {
  padding: 44px 48px 0;
  border-bottom: 1px solid var(--cream2);
  padding-bottom: 28px;
}
.content-eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.content-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 600; color: var(--navy);
  line-height: 1.15; letter-spacing: -0.3px;
}
.content-subtitle {
  font-size: 15px; color: var(--muted); margin-top: 8px;
  font-weight: 300; max-width: 580px;
}
.content-date {
  font-size: 12px; color: var(--muted); margin-top: 14px;
}

.content-body { padding: 36px 48px 60px; }


/* ═══════════════════════════════════════
   JOURNEY TRACKER (signature element)
═══════════════════════════════════════ */
.journey-tracker {
  background: var(--navy);
  border-radius: 10px;
  padding: 22px 32px;
  margin-bottom: 36px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0;
  position: relative;
}
.journey-line {
  position: absolute; top: 50%; left: 72px; right: 72px;
  height: 1px; background: rgba(255,255,255,0.1);
  transform: translateY(-50%); z-index: 0;
}
.journey-line-filled {
  position: absolute; top: 50%; left: 72px;
  height: 2px; background: var(--gold);
  transform: translateY(-50%); z-index: 1;
  transition: width 0.6s ease;
}
.journey-step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 2; flex: 1; text-align: center;
}
.journey-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,0.3);
  transition: all 0.3s;
}
.journey-step.visited .journey-dot {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}
.journey-label {
  font-size: 10.5px; font-weight: 500;
  color: rgba(255,255,255,0.35); letter-spacing: 0.5px;
  transition: color 0.3s;
}
.journey-step.visited .journey-label { color: var(--gold2); }


/* ═══════════════════════════════════════
   SECTION CARDS (Dashboard grid)
═══════════════════════════════════════ */
.section-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 22px; margin-bottom: 32px;
}

.section-card {
  background: #fff;
  border: 1px solid var(--cream2);
  border-radius: 10px;
  padding: 28px;
  transition: all 0.22s ease;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.section-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--cream2);
  transition: background 0.22s;
}
.section-card:hover::before { background: var(--gold); }
.section-card:hover {
  border-color: rgba(200,164,86,0.3);
  box-shadow: 0 6px 24px rgba(11,25,41,0.08);
  transform: translateY(-2px);
}
.section-card.coming-soon { opacity: 0.7; cursor: default; }
.section-card.coming-soon:hover { transform: none; box-shadow: none; }

.card-icon {
  font-size: 24px; margin-bottom: 14px;
  display: inline-block;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600; color: var(--navy);
  margin-bottom: 8px; line-height: 1.2;
}
.card-desc {
  font-size: 13.5px; color: var(--muted);
  line-height: 1.6; flex: 1; margin-bottom: 18px;
}
.card-meta {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--cream2);
}
.card-link {
  font-size: 12px; font-weight: 500; color: var(--gold);
  letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 5px;
  margin-top: 4px; transition: color 0.18s;
}
.card-link:hover { color: var(--navy); }
.badge {
  display: inline-block; font-size: 9px; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: var(--cream2); color: var(--muted);
}
.badge.gold { background: rgba(200,164,86,0.15); color: var(--gold); }
.badge.new { background: rgba(30,120,60,0.12); color: #1e7840; }


/* ═══════════════════════════════════════
   ARTICLE CARDS (Educación)
═══════════════════════════════════════ */
.article-list { display: flex; flex-direction: column; gap: 16px; }

.article-card {
  background: #fff; border: 1px solid var(--cream2);
  border-radius: 10px; padding: 24px 28px;
  display: flex; align-items: flex-start;
  gap: 20px; transition: all 0.2s ease;
}
.article-card:hover {
  border-color: rgba(200,164,86,0.3);
  box-shadow: 0 4px 18px rgba(11,25,41,0.07);
}
.article-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 600; color: var(--cream2);
  line-height: 1; flex-shrink: 0; min-width: 36px;
  padding-top: 2px;
}
.article-content { flex: 1; }
.article-category {
  font-size: 10px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.article-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px; font-weight: 600; color: var(--navy);
  line-height: 1.25; margin-bottom: 8px;
}
.article-excerpt {
  font-size: 13.5px; color: var(--muted); line-height: 1.65;
  max-width: 580px; margin-bottom: 14px;
}
.article-footer {
  display: flex; align-items: center; gap: 16px;
}
.article-time { font-size: 11px; color: var(--muted); }


/* ═══════════════════════════════════════
   TOOL CARDS (Herramientas)
═══════════════════════════════════════ */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.tool-card {
  background: #fff; border: 1px solid var(--cream2);
  border-radius: 10px; padding: 28px;
  transition: all 0.2s ease; display: flex; flex-direction: column;
}
.tool-card:hover {
  border-color: rgba(200,164,86,0.35);
  box-shadow: 0 5px 22px rgba(11,25,41,0.08);
  transform: translateY(-2px);
}
.tool-card.disabled { opacity: 0.55; pointer-events: none; }
.tool-icon { font-size: 28px; margin-bottom: 14px; }
.tool-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 8px;
}
.tool-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 20px; }
.btn-tool {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy); color: var(--gold2);
  font-size: 11.5px; font-weight: 500; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 10px 18px; border-radius: 5px;
  border: none; cursor: pointer; transition: all 0.18s;
  font-family: 'DM Sans', sans-serif; text-decoration: none;
  align-self: flex-start;
}
.btn-tool:hover { background: var(--navy3); }
.btn-tool.secondary {
  background: transparent; border: 1px solid var(--cream2);
  color: var(--muted);
}
.btn-tool.secondary:hover { border-color: var(--gold); color: var(--gold); }


/* ═══════════════════════════════════════
   ONBOARDING STEPS (Bienvenida)
═══════════════════════════════════════ */
.onboard-steps { display: flex; flex-direction: column; gap: 18px; max-width: 720px; }

.onboard-step {
  background: #fff; border: 1px solid var(--cream2);
  border-radius: 10px; padding: 26px 28px;
  display: flex; gap: 22px; align-items: flex-start;
  transition: all 0.2s;
}
.onboard-step:hover { border-color: rgba(200,164,86,0.3); box-shadow: 0 4px 18px rgba(11,25,41,0.06); }
.step-number {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.onboard-step.completed .step-number {
  background: var(--gold); color: var(--navy);
}
.step-body { flex: 1; }
.step-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px; font-weight: 600; color: var(--navy); margin-bottom: 6px;
}
.step-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.step-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--gold);
  letter-spacing: 0.5px; transition: color 0.18s;
}
.step-action:hover { color: var(--navy); }


/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
.login-page {
  min-height: 100vh; background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; top: -30%; left: 50%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(200,164,86,0.06) 0%, transparent 70%);
  transform: translateX(-50%); pointer-events: none;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--navy2); border: 1px solid rgba(200,164,86,0.2);
  border-radius: 12px; padding: 44px 40px;
  position: relative; z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.login-brand img { width: 36px; height: 36px; object-fit: contain; opacity: 0.95; }
.login-brand-text .title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 600; color: #fff; line-height: 1.1;
}
.login-brand-text .sub {
  font-size: 9.5px; font-weight: 500; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold);
}
.login-divider {
  height: 1px; background: rgba(200,164,86,0.15);
  margin: 22px 0;
}
.login-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 600; color: #fff;
  line-height: 1.2; margin-bottom: 8px;
}
.login-tagline {
  font-size: 13.5px; color: rgba(255,255,255,0.5);
  line-height: 1.6; margin-bottom: 28px;
}
.btn-login {
  width: 100%; background: var(--gold); color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 14px;
  border: none; border-radius: 5px; cursor: pointer;
  transition: all 0.2s; margin-bottom: 14px;
}
.btn-login:hover { background: var(--gold2); }
.btn-login.secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(200,164,86,0.25);
  color: rgba(255,255,255,0.7);
}
.btn-login.secondary:hover {
  background: rgba(255,255,255,0.09); color: #fff;
}
.login-footer {
  margin-top: 24px; text-align: center;
  font-size: 12px; color: rgba(255,255,255,0.3);
}
.login-footer a { color: rgba(200,164,86,0.7); }
.login-footer a:hover { color: var(--gold); }

/* Netlify Identity widget overrides */
[data-netlify-identity-button] { display: none !important; }


/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════ */
.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px; background: var(--navy);
  border-bottom: 1px solid rgba(200,164,86,0.12);
  align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 200;
}
.mobile-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 600; color: #fff;
}
.mobile-brand span { color: var(--gold); }
.mobile-menu-btn {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.mobile-menu-btn:hover { color: #fff; }

@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }

  .academy-sidebar { transform: translateX(-270px); transition: transform 0.28s ease; width: 270px; }
  .academy-sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
  }
  .sidebar-overlay.visible { display: block; }

  .academy-content { margin-left: 0; padding-top: 56px; }
  .mobile-topbar { display: flex; }

  .content-header { padding: 28px 20px 20px; }
  .content-body { padding: 24px 20px 48px; }
  .content-title { font-size: 28px; }

  .section-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }

  .journey-tracker { padding: 18px 16px; gap: 0; }
  .journey-label { font-size: 9px; }

  .article-card { flex-direction: column; gap: 12px; }
  .article-number { font-size: 24px; }
}
