/* AI Studio at S2 — shared styles */

:root {
  --s2-navy: #1F4E79;
  --s2-navy-dark: #163A5C;
  --s2-navy-light: #EAF1F8;
  --s2-accent: #C77F2C;
  --s2-accent-light: #FBF1E3;
  --s2-text: #1A1A1A;
  --s2-text-muted: #5A5A5A;
  --s2-text-faint: #888;
  --s2-bg: #FAFBFC;
  --s2-surface: #FFFFFF;
  --s2-border: #E5E7EB;
  --s2-border-strong: #CBD5E1;
  --s2-success: #15803D;
  --s2-warn: #B45309;
  --s2-danger: #B91C1C;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--s2-text);
  background: var(--s2-bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--s2-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em 0; line-height: 1.25; color: var(--s2-text); font-weight: 700; }
h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 0.9em 0; }

/* ----- Layout chassis ----- */

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--s2-surface);
  border-right: 1px solid var(--s2-border);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--s2-border);
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--s2-navy);
  color: white;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-name { font-weight: 700; line-height: 1.1; }
.brand-name small { display: block; font-weight: 400; color: var(--s2-text-muted); font-size: 0.78rem; }

.nav-section { margin-top: 18px; }
.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s2-text-faint);
  padding: 0 8px 6px;
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--s2-text);
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-bottom: 1px;
}
.nav a:hover { background: var(--s2-navy-light); color: var(--s2-navy); text-decoration: none; }
.nav a.active { background: var(--s2-navy-light); color: var(--s2-navy); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: 0.7; }

.content {
  padding: 36px 56px 80px;
  max-width: 1100px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--s2-text-muted);
}
.breadcrumb a { color: var(--s2-text-muted); }
.breadcrumb-sep { margin: 0 6px; color: var(--s2-text-faint); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s2-surface);
  border: 1px solid var(--s2-border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--s2-text-muted);
}
.user-avatar {
  width: 24px; height: 24px;
  background: var(--s2-navy);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ----- Typography helpers ----- */

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--s2-navy);
  font-weight: 700;
  margin-bottom: 8px;
}
.lede {
  font-size: 1.15rem;
  color: var(--s2-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 64ch;
}
.muted { color: var(--s2-text-muted); }
.faint { color: var(--s2-text-faint); }

/* ----- Cards ----- */

.card {
  background: var(--s2-surface);
  border: 1px solid var(--s2-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--s2-border-strong); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { text-decoration: none; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--s2-text-muted); font-size: 0.93rem; margin-bottom: 0; }
.card .card-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s2-text-faint);
  margin-bottom: 8px;
  font-weight: 600;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ----- Hero ----- */

.hero {
  background: linear-gradient(135deg, var(--s2-navy) 0%, var(--s2-navy-dark) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 40px 44px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 60%; height: 180%;
  background: radial-gradient(circle, rgba(199, 127, 44, 0.18) 0%, transparent 65%);
  pointer-events: none;
}
.hero .eyebrow { color: rgba(255,255,255,0.7); }
.hero h1 { color: white; margin-bottom: 14px; max-width: 22ch; }
.hero p { color: rgba(255,255,255,0.9); font-size: 1.05rem; max-width: 62ch; }
.hero .cta-row { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ----- Buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.93rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--s2-accent); color: #1A1A1A; }
.btn-primary:hover { background: #B36F1F; color: #1A1A1A; text-decoration: none; }
.btn-ghost-light { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.3); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.18); color: white; text-decoration: none; }
.btn-outline { background: transparent; color: var(--s2-navy); border-color: var(--s2-border-strong); }
.btn-outline:hover { background: var(--s2-navy-light); text-decoration: none; }

/* ----- Pills and badges ----- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--s2-navy-light);
  color: var(--s2-navy);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.accent { background: var(--s2-accent-light); color: var(--s2-warn); }
.pill.success { background: #DCFCE7; color: var(--s2-success); }
.pill.outline { background: transparent; border: 1px solid var(--s2-border-strong); color: var(--s2-text-muted); }

/* ----- Module / session lists ----- */

.module-list { list-style: none; padding: 0; margin: 0; }
.module-list li {
  padding: 16px 20px;
  border: 1px solid var(--s2-border);
  background: var(--s2-surface);
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.module-list .module-num {
  width: 36px; height: 36px;
  background: var(--s2-navy);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.module-list .module-num.accent { background: var(--s2-accent); color: #1A1A1A; }
.module-body { flex: 1; }
.module-body h4 { margin: 2px 0 6px 0; }
.module-body p { font-size: 0.93rem; color: var(--s2-text-muted); margin: 0; }
.module-time {
  font-size: 0.78rem;
  color: var(--s2-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ----- Section ----- */

section { margin: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.9rem; }

/* ----- Levels viz ----- */

.levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 24px 0;
}
.level-card {
  background: var(--s2-surface);
  border: 1px solid var(--s2-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  position: relative;
  transition: all 0.15s ease;
}
.level-card .level-num {
  width: 28px; height: 28px;
  background: var(--s2-navy-light);
  color: var(--s2-navy);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.level-card h4 { margin: 0 0 4px 0; font-size: 0.95rem; }
.level-card p { font-size: 0.83rem; color: var(--s2-text-muted); margin: 0; }
.level-card.level-1 { border-top: 4px solid #93C5FD; }
.level-card.level-2 { border-top: 4px solid #60A5FA; }
.level-card.level-3 { border-top: 4px solid #3B82F6; }
.level-card.level-4 { border-top: 4px solid var(--s2-navy); }
.level-card.level-5 { border-top: 4px solid var(--s2-accent); }
@media (max-width: 900px) { .levels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .levels { grid-template-columns: 1fr; } }

/* ----- Callout ----- */

.callout {
  background: var(--s2-navy-light);
  border-left: 4px solid var(--s2-navy);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0;
}
.callout.warn { background: #FEF3C7; border-left-color: var(--s2-warn); }
.callout.accent { background: var(--s2-accent-light); border-left-color: var(--s2-accent); }
.callout .callout-label {
  font-weight: 700;
  color: var(--s2-navy);
  margin-right: 6px;
}
.callout.warn .callout-label { color: var(--s2-warn); }
.callout.accent .callout-label { color: var(--s2-accent); }

/* ----- Tables ----- */

table.simple {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--s2-surface);
  border: 1px solid var(--s2-border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.simple th, table.simple td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--s2-border);
  font-size: 0.92rem;
}
table.simple th {
  background: var(--s2-navy-light);
  color: var(--s2-navy);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.simple tr:last-child td { border-bottom: 0; }

/* ----- Signin gate ----- */

.signin-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--s2-navy-light) 0%, var(--s2-bg) 100%);
  padding: 24px;
}
.signin-card {
  background: var(--s2-surface);
  border: 1px solid var(--s2-border);
  border-radius: var(--radius);
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.signin-card .brand-mark { margin: 0 auto 18px; width: 48px; height: 48px; font-size: 17px; }
.signin-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.signin-card p { color: var(--s2-text-muted); font-size: 0.95rem; }
.signin-form { margin-top: 22px; text-align: left; }
.signin-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--s2-text-muted); margin-bottom: 4px; }
.signin-form input {
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--s2-border-strong);
  font-size: 0.95rem; font-family: inherit;
  margin-bottom: 12px;
}
.signin-form input:focus { outline: 2px solid var(--s2-navy); outline-offset: 1px; }
.signin-form .btn { width: 100%; justify-content: center; }
.signin-hint { font-size: 0.8rem; color: var(--s2-text-faint); margin-top: 14px; }

/* ----- Search input ----- */

.search-bar {
  display: flex;
  align-items: center;
  background: var(--s2-surface);
  border: 1px solid var(--s2-border-strong);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 16px;
}
.search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
}
.search-bar .icon { color: var(--s2-text-faint); margin-right: 8px; }

/* ----- Footer ----- */

.foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--s2-border);
  color: var(--s2-text-faint);
  font-size: 0.85rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ----- Mobile ----- */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--s2-border);
  }
  .content { padding: 24px 22px 60px; }
  .hero { padding: 28px 24px; }
  h1 { font-size: 1.75rem; }
}

/* ----- Print-friendly ----- */
@media print {
  .sidebar, .topbar, .foot { display: none; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .hero { background: white; color: var(--s2-text); border: 1px solid var(--s2-border); }
  .hero h1, .hero p { color: var(--s2-text); }
}
