/* Easy Solution Enrollment System
   Design: DM Sans, brand #036EB8, max-width 1050px, mobile 390px
   Following frontend-design + impeccable principles: restrained, clean, no AI tells */

:root {
  --blue: #036EB8;
  --blue-dark: #025591;
  --blue-light: #EFF6FF;
  --green: #16A34A;
  --red: #DC2626;
  --amber: #D97706;
  --ink: #1E293B;
  --gray: #64748B;
  --gray-light: #94A3B8;
  --border: #E2E8F0;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --radius: 10px;
  --max: 1050px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

@media (max-width: 390px) {
  .container { padding: 0 20px; }
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
}
.header-logo span { color: var(--ink); font-weight: 400; }
.header-nav { display: flex; gap: 24px; align-items: center; }
.header-nav a { font-size: 14px; color: var(--gray); }
.header-nav a:hover { color: var(--blue); }
.header-user { font-size: 14px; color: var(--gray); }
.header-user b { color: var(--ink); }
.header-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.header-logout:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 390px) {
  .header-inner { padding: 12px 20px; }
  .header-nav { gap: 12px; }
  .header-nav a { font-size: 13px; }
}

/* Hero */
.hero {
  background: var(--blue);
  color: #fff;
  padding: 48px 0;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.hero p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 560px;
}

/* Course grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 40px 0;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.course-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.course-card-header { padding: 20px 20px 0; }
.course-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.badge-qf { background: var(--blue-light); color: var(--blue); }
.badge-hot { background: #FEF2F2; color: var(--red); }
.badge-new { background: #FEFCE8; color: var(--amber); }
.badge-children { background: #F0FDF4; color: var(--green); }
.badge-prof { background: #F5F3FF; color: #7C3AED; }

.course-card h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}
.course-card .course-cn { font-size: 13px; color: var(--gray); margin-bottom: 12px; }
.course-card .course-brand { font-size: 12px; color: var(--gray-light); margin-bottom: 6px; }
.course-card .course-desc { font-size: 14px; color: var(--gray); margin-bottom: 16px; flex: 1; }

.course-card-meta {
  padding: 0 20px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--gray);
}
.course-card-meta span { display: flex; align-items: center; gap: 4px; }

.course-card-price {
  padding: 0 20px 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
}
.course-card-price small { font-size: 12px; color: var(--gray); font-weight: 400; }

.course-card-vacancy {
  padding: 0 20px 16px;
  font-size: 12px;
  font-weight: 600;
}
.vacancy-low { color: var(--red); }
.vacancy-med { color: var(--amber); }
.vacancy-high { color: var(--green); }

.course-card-btn {
  display: block;
  text-align: center;
  padding: 14px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-top: auto;
}
.course-card-btn:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }

/* Auth forms */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 32px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.auth-card .auth-sub {
  font-size: 14px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 28px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(3,110,184,0.1);
}
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--gray);
}
.auth-link a { font-weight: 600; }

.error-msg {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--red);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

.success-msg {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: var(--green);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.success-msg.show { display: block; }

/* Enrollment form */
.enroll-page { padding: 40px 0; }
.enroll-course-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.enroll-course-info h3 { font-size: 18px; font-weight: 700; }
.enroll-course-info .price { font-size: 24px; font-weight: 700; color: var(--blue); }

.pay-options { display: flex; gap: 12px; margin-bottom: 24px; }
.pay-option {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}
.pay-option.selected { border-color: var(--blue); background: var(--blue-light); }
.pay-option h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.pay-option p { font-size: 13px; color: var(--gray); }

/* Status page */
.status-wrap {
  max-width: 520px;
  margin: 60px auto;
  padding: 0 32px;
}
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
}
.status-icon { font-size: 48px; margin-bottom: 16px; }
.status-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.status-card .ref { font-size: 14px; color: var(--gray); margin-bottom: 24px; }
.status-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}
.status-pending { background: #FEFCE8; color: var(--amber); }
.status-approved { background: #F0FDF4; color: var(--green); }
.status-rejected { background: #FEF2F2; color: var(--red); }

.status-detail { text-align: left; margin-top: 20px; }
.status-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.status-detail-row:last-child { border-bottom: none; }
.status-detail-row span:first-child { color: var(--gray); }
.status-detail-row span:last-child { font-weight: 600; }

/* Dashboard */
.dashboard { padding: 40px 0; }
.dashboard h1 { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.enrollment-list { display: flex; flex-direction: column; gap: 12px; }
.enrollment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.enrollment-item .enr-info h4 { font-size: 15px; font-weight: 700; }
.enrollment-item .enr-info p { font-size: 13px; color: var(--gray); margin-top: 2px; }
.enrollment-item .enr-ref { font-size: 12px; color: var(--gray-light); font-family: monospace; }

/* Collapsible details */
details {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
}
details[open] summary { margin-bottom: 12px; }
details p { font-size: 14px; color: var(--gray); line-height: 1.7; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 60px;
}

@media (max-width: 390px) {
  .hero { padding: 32px 0; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .auth-wrap { margin: 32px auto; }
  .auth-card { padding: 24px 20px; }
  .course-grid { padding: 24px 0; gap: 16px; }
  .pay-options { flex-direction: column; }
}