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

:root {
  color-scheme: light;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --text: #111827;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #ffffff;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
p { margin-bottom: .75rem; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Nav ── */
.nav {
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 1100px; margin: 0 auto; padding: 0 20px;
}
.nav-logo { font-size: 1.1rem; font-weight: 700; color: var(--primary); letter-spacing: -.3px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 6px 14px; border-radius: 6px; font-size: .875rem; font-weight: 500;
  color: var(--text-light); transition: all .18s;
}
.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-links a.active { color: var(--primary); background: var(--primary-light); }
.nav-cart {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary); color: var(--white) !important;
  padding: 7px 16px; border-radius: 8px; font-size: .875rem; font-weight: 600;
}
.nav-cart:hover { background: var(--primary-dark) !important; color: var(--white) !important; }
.cart-count {
  background: var(--white); color: var(--primary);
  border-radius: 20px; padding: 0 6px; font-size: .75rem; font-weight: 700; min-width: 20px; text-align: center;
}

/* ── Page Hero ── */
.page-hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  padding: 56px 0 48px; color: var(--white);
}
.page-hero .eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 14px;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.5px; margin-bottom: 12px; }
.page-hero p { font-size: 1.05rem; color: rgba(255,255,255,.8); max-width: 520px; }

/* ── Section ── */
.section { padding: 64px 0; }
.section-alt { background: var(--white); }
.section-header { margin-bottom: 40px; }
.section-header h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.3px; margin-bottom: 6px; }
.section-header p { color: var(--text-light); font-size: .95rem; }

/* ── Course Grid ── */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.course-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: all .2s;
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.course-thumb {
  height: 120px; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; background: var(--primary-light);
}
.course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.course-level {
  display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; padding: 3px 9px; border-radius: 20px; margin-bottom: 10px;
}
.level-beginner { background: #dcfce7; color: #16a34a; }
.level-intermediate { background: #fef3c7; color: #b45309; }
.level-advanced { background: #fee2e2; color: #dc2626; }
.course-name { font-size: 1rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -.2px; }
.course-desc { font-size: .855rem; color: var(--text-light); flex: 1; margin-bottom: 16px; }
.course-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.course-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.course-duration { font-size: .8rem; color: var(--text-light); }
.btn-add {
  width: 100%; padding: 9px; border: none; border-radius: 7px; cursor: pointer;
  font-size: .875rem; font-weight: 600; font-family: inherit; transition: all .18s;
  background: var(--primary); color: var(--white);
}
.btn-add:hover { background: var(--primary-dark); }
.btn-add.added { background: var(--success); }
.btn-add:disabled { opacity: .6; cursor: default; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: 8px; border: none; cursor: pointer;
  font-size: .9rem; font-weight: 600; font-family: inherit; transition: all .18s;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-lg { padding: 13px 30px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"] {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: inherit; color: var(--text); background: var(--white);
  transition: border-color .18s; outline: none;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field-error { font-size: .8rem; color: var(--danger); margin-top: 4px; display: none; }
.field-error.show { display: block; }
input.invalid { border-color: var(--danger); }

/* ── Cart ── */
.cart-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { font-weight: 600; font-size: .9rem; }
.cart-item-meta { font-size: .8rem; color: var(--text-light); margin-top: 2px; }
.cart-item-price { font-weight: 700; color: var(--primary); font-size: .95rem; white-space: nowrap; }
.cart-empty { text-align: center; padding: 48px 20px; color: var(--text-light); }
.cart-empty svg { margin: 0 auto 12px; opacity: .3; }

/* ── Card box ── */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead { background: var(--bg); }
th { padding: 11px 16px; text-align: left; font-size: .77rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; }
td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #f9fafb; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 9px;
  border-radius: 20px; background: var(--primary-light); color: var(--primary);
}

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: .875rem; font-weight: 500; margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Totals ── */
.total-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .9rem; }
.total-row.grand { font-weight: 700; font-size: 1.05rem; border-top: 1.5px solid var(--border); margin-top: 8px; padding-top: 14px; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 24px; }
.page-btn {
  padding: 6px 13px; border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--white); cursor: pointer; font-size: .85rem; font-weight: 500; font-family: inherit;
  transition: all .18s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 48px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-logo { font-weight: 700; color: var(--primary); font-size: 1rem; letter-spacing: -.2px; }
.footer p { font-size: .82rem; color: var(--text-light); margin: 0; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: .82rem; color: var(--text-light); transition: color .18s; }
.footer-links a:hover { color: var(--primary); }

/* ── Demo banner ── */
.demo-banner {
  background: #1e293b; color: rgba(255,255,255,.85); text-align: center;
  padding: 8px 16px; font-size: .78rem; font-weight: 500;
}
.demo-banner a { color: #60a5fa; text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.nav-cart) { display: none; }
}
@media (max-width: 520px) {
  .course-grid { grid-template-columns: 1fr; }
}
