/* ============================================================
   BLOCKWELL ACADEMY — Student Portal Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --green:       #1a5c2e;
  --green-mid:   #216b36;
  --green-light: #7db82f;
  --red:         #c0272d;
  --blue:        #1e6ea6;
  --black:       #111713;
  --off-white:   #f5f7f4;
  --white:       #ffffff;
  --muted:       #5a6a5e;
  --border:      #d6e4d9;
  --sidebar-w:   260px;
  --font:        'DM Sans', sans-serif;
  --display:     'Playfair Display', serif;
  --shadow:      0 2px 12px rgba(26,92,46,0.10);
  --shadow-md:   0 6px 24px rgba(26,92,46,0.14);
  --radius:      10px;
  --radius-lg:   16px;
  --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--black); background: var(--off-white); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── PASSWORD TOGGLE ── */
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; padding: 0; line-height: 1;
}
.pw-toggle:hover { color: var(--green); }

/* ── AUTH PAGES (login/register) ── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  background: linear-gradient(155deg, #0d3319 0%, #1a5c2e 60%, #216b36 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  right: -80px; bottom: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(125,184,47,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-left__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.auth-left__logo img { height: 52px; }
.auth-left__logo-text strong { display: block; font-family: var(--display); font-size: 1.2rem; color: white; }
.auth-left__logo-text span  { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

.auth-left__title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  color: white;
  line-height: 1.15;
  margin-bottom: 20px;
}

.auth-left__title em { font-style: italic; color: var(--green-light); }

.auth-left__sub {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  margin-bottom: 40px;
  max-width: 380px;
}

.auth-left__features { display: flex; flex-direction: column; gap: 14px; }
.auth-left__feature {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.8); font-size: 0.9rem;
}
.auth-left__feature-icon {
  width: 36px; height: 36px;
  background: rgba(125,184,47,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: white;
  overflow-y: auto;
}

.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap h2 { font-family: var(--display); font-size: 1.8rem; color: var(--green); margin-bottom: 6px; }
.auth-form-wrap p { color: var(--muted); font-size: 0.9rem; margin-bottom: 32px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--green); margin-bottom: 7px; }
.form-input, .form-select {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 0.95rem; color: var(--black);
  background: white; transition: var(--transition);
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,92,46,0.08); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 8px; font-family: var(--font);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--green); color: white; border-color: var(--green); }
.btn-primary:hover { background: var(--green-mid); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent  { background: var(--green-light); color: white; border-color: var(--green-light); }
.btn-accent:hover { background: #6aa624; }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: white; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.83rem; }
.btn-danger { background: var(--red); color: white; border-color: var(--red); }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fdecea; color: #a82025; border: 1px solid #f5b8b8; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 0.82rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-link { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--muted); }
.auth-link a { color: var(--green); font-weight: 600; }

/* ── PORTAL LAYOUT ── */
.portal-layout { display: flex; min-height: 100vh; }

.portal-sidebar {
  width: var(--sidebar-w);
  background: var(--green);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 100;
  transition: transform var(--transition);
}

.portal-sidebar__brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.portal-sidebar__brand a { display: flex; align-items: center; gap: 10px; }
.portal-sidebar__brand img { height: 40px; }
.portal-sidebar__brand-text strong { display: block; font-family: var(--display); font-size: 1rem; color: white; }
.portal-sidebar__brand-text span   { font-size: 0.7rem; color: rgba(255,255,255,0.55); }

.portal-sidebar__student {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 10px;
}

.portal-sidebar__avatar {
  width: 38px; height: 38px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: white; flex-shrink: 0;
}

.portal-sidebar__student-name { font-size: 0.88rem; font-weight: 600; color: white; }
.portal-sidebar__student-email { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.portal-sidebar__nav { flex: 1; padding: 12px 0; }

.portal-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.portal-nav-link:hover, .portal-nav-link.active {
  color: white; background: rgba(255,255,255,0.08);
  border-left-color: var(--green-light);
}
.portal-nav-link .icon { font-size: 1rem; width: 20px; text-align: center; }

.portal-sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.portal-sidebar__footer a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.5); font-size: 0.83rem;
  transition: var(--transition);
}
.portal-sidebar__footer a:hover { color: white; }

/* ── PORTAL MAIN ── */
.portal-main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}

.portal-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.portal-topbar__title { font-family: var(--display); font-size: 1.15rem; color: var(--green); }
.portal-topbar__right { display: flex; align-items: center; gap: 12px; }

.portal-content { padding: 32px; flex: 1; }

/* ── DASHBOARD CARDS ── */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }

.dash-card {
  background: white; border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border-left: 4px solid var(--green);
}
.dash-card:nth-child(2) { border-left-color: var(--blue); }
.dash-card:nth-child(3) { border-left-color: var(--green-light); }

.dash-card__icon {
  width: 52px; height: 52px;
  background: #e8f5e3; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.dash-card:nth-child(2) .dash-card__icon { background: #dbeafe; }
.dash-card:nth-child(3) .dash-card__icon { background: #f0fdf4; }

.dash-card__num  { font-family: var(--display); font-size: 2rem; font-weight: 700; color: var(--green); line-height: 1; }
.dash-card__label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ── COURSE CARDS ── */
.course-portal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.course-portal-card {
  background: white; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1.5px solid var(--border);
}
.course-portal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.course-portal-card__header {
  padding: 24px 24px 20px;
  background: linear-gradient(135deg, var(--green), #2d7a40);
  color: white;
}
.course-portal-card:nth-child(2) .course-portal-card__header { background: linear-gradient(135deg, var(--blue), #2980b9); }
.course-portal-card:nth-child(3) .course-portal-card__header { background: linear-gradient(135deg, #7d2f2f, var(--red)); }

.course-portal-card__level { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; margin-bottom: 4px; }
.course-portal-card__title { font-family: var(--display); font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }

.progress-bar-wrap { background: rgba(255,255,255,0.2); border-radius: 100px; height: 6px; margin-bottom: 6px; }
.progress-bar-fill { background: white; border-radius: 100px; height: 6px; transition: width 0.6s ease; }
.progress-label { font-size: 0.75rem; opacity: 0.85; }

.course-portal-card__body { padding: 20px 24px; }
.course-portal-card__status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; margin-bottom: 14px; }
.status-active    { color: var(--green); }
.status-pending   { color: #d97706; }
.status-completed { color: var(--blue); }

/* ── MATERIALS ── */
.module-block {
  background: white; border-radius: var(--radius-lg);
  border: 1.5px solid var(--border); margin-bottom: 16px;
  overflow: hidden; box-shadow: var(--shadow);
}
.module-header {
  padding: 18px 24px; background: #f5f7f4;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.module-title { font-family: var(--display); font-size: 1rem; color: var(--green); }
.module-progress-pill {
  font-size: 0.75rem; font-weight: 600;
  background: var(--green); color: white;
  padding: 3px 10px; border-radius: 100px;
}

.material-list { padding: 0; }
.material-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid #f0f4f0;
  transition: var(--transition);
}
.material-item:last-child { border-bottom: none; }
.material-item:hover { background: #fafcfa; }

.material-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.material-icon.pdf   { background: #fdecea; }
.material-icon.video { background: #dbeafe; }
.material-icon.link  { background: #f0fdf4; }
.material-icon.doc   { background: #fef3c7; }

.material-info { flex: 1; }
.material-title { font-size: 0.92rem; font-weight: 600; color: var(--black); }
.material-type  { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.material-check {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; cursor: pointer;
  transition: var(--transition); flex-shrink: 0;
}
.material-check.done { background: var(--green); border-color: var(--green); color: white; }

/* ── PAYMENT CARD ── */
.payment-card {
  background: white; border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow);
  border: 1.5px solid var(--border); max-width: 520px;
}
.payment-amount {
  font-family: var(--display); font-size: 3rem;
  font-weight: 700; color: var(--green); margin: 12px 0 4px;
}
.payment-note { font-size: 0.85rem; color: var(--muted); margin-bottom: 24px; }

/* ── CERTIFICATE ── */
.certificate-wrap {
  background: white; border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow);
  border: 3px solid var(--green-light); text-align: center;
}
.certificate-icon { font-size: 4rem; margin-bottom: 16px; }
.certificate-title { font-family: var(--display); font-size: 1.5rem; color: var(--green); margin-bottom: 8px; }
.certificate-sub { color: var(--muted); margin-bottom: 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left  { display: none; }
  .portal-sidebar { transform: translateX(-100%); }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .course-portal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr; }
  .portal-content { padding: 20px 16px; }
  .form-row-2 { grid-template-columns: 1fr; }
}
