@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --primary:       #066CCB;
  --primary-dark:  #071431;
  --navy:          #071431;
  --accent:        #00d084;
  --danger:        #ef4444;
  --white:         #ffffff;
  --bg:            #f0f4fa;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --muted:         #64748b;
  --font-body:     'Inter', sans-serif;
  --font-heading:  'Outfit', sans-serif;
  --radius:        12px;
  --radius-lg:     18px;
  --transition:    all .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }
*, *::before, *::after { box-shadow: none !important; }

/* ── Auth layout (login / register / reset) ─────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px;
}
.auth-brand-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,.1); padding: 8px;
  margin-bottom: 32px; position: relative;
}
.auth-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand h1 {
  font-family: var(--font-heading); font-size: clamp(1.8rem,3vw,2.6rem);
  font-weight: 800; color: #fff; line-height: 1.2; position: relative; margin-bottom: 16px;
}
.auth-brand h1 span { color: var(--primary); }
.auth-brand p { color: rgba(255,255,255,.6); font-size: 1rem; max-width: 380px; position: relative; }
.auth-features { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.8); font-size: .9rem; font-weight: 500;
}
.auth-feature i { color: var(--primary); width: 18px; text-align: center; }

.auth-form-side {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 60px 48px; background: var(--white);
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap h2 {
  font-family: var(--font-heading); font-size: 1.7rem;
  font-weight: 800; color: var(--navy); margin-bottom: 6px;
}
.auth-form-wrap .auth-sub { color: var(--muted); font-size: .92rem; margin-bottom: 32px; }

/* ── Form controls ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-weight: 600; font-size: .82rem;
  color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); font-size: .9rem; color: var(--text);
  background: var(--white); transition: var(--transition); outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  background: #f8fbff;
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
textarea.form-control { height: auto; padding: 10px 14px; resize: vertical; }

/* password toggle wrapper */
.input-eye {
  position: relative;
}
.input-eye .form-control { padding-right: 42px; }
.input-eye .eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .9rem; padding: 4px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 24px; height: 44px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .9rem; font-weight: 700;
  transition: var(--transition); cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0559a8; }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: rgba(6,108,203,.07); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 36px; padding: 0 16px; font-size: .82rem; border-radius: 8px; }

/* ── Alert banner ────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500; display: none; margin-bottom: 18px;
}
.alert.show { display: flex; align-items: center; gap: 10px; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Dashboard shell ─────────────────────────────────────── */
.student-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.s-sidebar {
  background: var(--navy);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.s-sidebar-head {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.s-sidebar-logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.1); padding: 4px; }
.s-sidebar-logo img { width: 100%; object-fit: contain; }
.s-sidebar-brand { font-family: var(--font-heading); font-size: .82rem; font-weight: 800; color: #fff; }
.s-sidebar-brand span { display: block; font-size: .6rem; color: rgba(255,255,255,.4); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.s-nav { padding: 10px 10px; flex: 1; }
.s-nav-label { font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); padding: 12px 8px 4px; display: block; }
.s-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 600; border-radius: 0 9px 9px 0;
  border-left: 3px solid transparent; margin-right: 4px;
  transition: var(--transition); text-decoration: none;
}
.s-nav-item i { width: 16px; text-align: center; font-size: .8rem; flex-shrink: 0; }
.s-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.s-nav-item.active { background: rgba(6,108,203,.2); color: #fff; border-left-color: var(--primary); }
.s-nav-item.s-logout { color: rgba(239,68,68,.7); }
.s-nav-item.s-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

.s-sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.s-user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.07);
}
.s-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; flex-shrink: 0;
}
.s-user-name { font-size: .82rem; font-weight: 700; color: #fff; }
.s-user-email { font-size: .68rem; color: rgba(255,255,255,.4); }

/* Main content area */
.s-main { display: flex; flex-direction: column; min-width: 0; }
.s-topbar {
  height: 60px; background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.s-page-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.s-content { flex: 1; padding: 28px; background: var(--bg); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.card-sub { font-size: .82rem; color: var(--muted); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; margin-bottom: 12px; }
.stat-card-value { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-card-label { font-size: .75rem; color: var(--muted); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Content grid (trainings / books) ───────────────────── */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.content-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition); display: flex; flex-direction: column;
  position: relative;
}
.content-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.content-card-thumb {
  height: 160px; background: #e8edf7;
  position: relative; overflow: hidden;
}
.content-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.content-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.content-card-title { font-weight: 700; font-size: .95rem; color: var(--navy); line-height: 1.35; }
.content-card-meta { font-size: .78rem; color: var(--muted); }
.content-card-foot { padding: 12px 16px; border-top: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* Lock overlay */
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(7,20,49,.55);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; color: #fff; backdrop-filter: blur(2px);
}
.lock-overlay i { font-size: 1.4rem; }
.lock-overlay span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ── Badge / tag ─────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-trial    { background: #fef3c7; color: #92400e; }
.badge-expired  { background: #fee2e2; color: #991b1b; }
.badge-pending  { background: #f1f5f9; color: #475569; }
.badge-blue     { background: #dbeafe; color: #1d4ed8; }

/* ── Subscription card ───────────────────────────────────── */
.sub-card {
  background: linear-gradient(135deg, var(--navy) 0%, #0a2254 100%);
  border-radius: var(--radius-lg); padding: 28px; color: #fff;
  position: relative; overflow: hidden;
}
.sub-card::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sub-card-content { position: relative; }
.sub-card-plan { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.sub-card-expires { font-size: .82rem; color: rgba(255,255,255,.6); margin-bottom: 20px; }
.sub-card-progress { background: rgba(255,255,255,.15); border-radius: 999px; height: 6px; margin-bottom: 8px; overflow: hidden; }
.sub-card-progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .6s ease; }
.sub-card-days { font-size: .78rem; color: rgba(255,255,255,.55); }

/* ── Pricing plans ───────────────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.plan-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  transition: var(--transition); position: relative;
}
.plan-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.plan-card.featured { border-color: var(--primary); }
.plan-featured-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  font-size: .68rem; font-weight: 800; padding: 3px 14px; border-radius: 999px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.plan-name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.plan-price { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.plan-price span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan-duration { font-size: .78rem; color: var(--muted); font-weight: 600; }
.plan-features { display: flex; flex-direction: column; gap: 8px; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text); }
.plan-feature i { color: var(--accent); font-size: .72rem; flex-shrink: 0; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────── */
#s-toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.s-toast {
  background: var(--navy); color: #fff; padding: 14px 18px;
  border-radius: 12px; font-size: .88rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px; max-width: 320px;
  border-left: 4px solid var(--primary);
  animation: toastIn .35s cubic-bezier(.16,1,.3,1) forwards;
}
.s-toast.error { border-left-color: var(--danger); background: #1a0a0a; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { padding: 40px 24px; }
}
@media (max-width: 768px) {
  .student-shell { grid-template-columns: 1fr; }
  .s-sidebar { display: none; }
  .s-content { padding: 16px; }
}
