/* ============================================================
   Auth Portal — Site Styles
   Light theme · Bootstrap 5 · DM Sans
   ============================================================ */

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-light: #e7f1ff;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e2e8f0;
  --text: #1a2236;
  --text-muted: #64748b;
  --shadow-lg: 0 20px 60px rgba(0,0,0,.10);
  --radius: 12px;
  --radius-sm: 8px;
  font-size: 15px;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--surface-alt);
  min-height: 100vh;
  margin: 0;
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(13,110,253,.12) 0%, transparent 70%),
    var(--surface-alt);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 4px 12px rgba(13,110,253,.35);
}

.auth-logo.sm { width: 32px; height: 32px; font-size: 15px; border-radius: 7px; }

.auth-brand-name {
  font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: -.3px;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%; max-width: 440px;
  border: 1px solid var(--border);
}

.auth-card-header { margin-bottom: 1.75rem; }

.auth-title {
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  margin: 0 0 .4rem; letter-spacing: -.4px;
}

.auth-subtitle {
  font-size: .9rem; color: var(--text-muted); margin: 0; line-height: 1.5;
}

.email-badge {
  display: inline-flex; align-items: center;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: .82rem; font-weight: 600;
  padding: .35rem .85rem; border-radius: 100px;
}
.email-badge a { color: inherit; }

.form-floating > .form-control {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--surface);
  font-size: .95rem;
  padding-right: 48px;
}
.form-floating > .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.form-floating > label { color: var(--text-muted); }

.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 4px; z-index: 10;
}
.password-toggle:hover { color: var(--primary); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; font-weight: 600; letter-spacing: .1px;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark), #084298);
  box-shadow: 0 4px 14px rgba(13,110,253,.35);
}

.btn-auth { padding: .75rem 1.25rem; border-radius: var(--radius-sm); font-size: .95rem; transition: all .2s; }

.btn-outline-primary { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-secondary { font-weight: 600; }

.divider-text {
  position: relative; text-align: center;
  color: var(--text-muted); font-size: .82rem; margin: .5rem 0;
}
.divider-text::before, .divider-text::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 70px); height: 1px; background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

.auth-link { color: var(--primary); font-size: .88rem; font-weight: 500; text-decoration: none; }
.auth-link:hover { color: var(--primary-dark); text-decoration: underline; }

.otp-icon-ring {
  width: 72px; height: 72px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto;
}

.otp-input {
  font-family: 'DM Mono', monospace; font-size: 2rem;
  letter-spacing: 8px; text-align: center;
  border-radius: var(--radius); border: 2px solid var(--border);
  padding: 1rem; background: var(--surface-alt); transition: all .2s;
}
.otp-input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,110,253,.12); background: var(--surface);
}

.success-checkmark {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #198754, #146c43);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 36px; margin: 0 auto;
  box-shadow: 0 6px 20px rgba(25,135,84,.3);
}

.auth-footer { color: var(--text-muted); font-size: .78rem; margin-top: 1.5rem; }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-layout { display: flex; min-height: 100vh; background: var(--surface-alt); }

.dashboard-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.5rem 0;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}

.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 1.25rem 1.5rem;
  font-weight: 700; font-size: .95rem; color: var(--text);
  border-bottom: 1px solid var(--border); margin-bottom: .5rem;
}

.sidebar-nav { flex: 1; padding: .5rem; }

.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  font-size: .9rem; font-weight: 500; transition: all .15s;
  background: none; border: none; cursor: pointer; margin-bottom: 2px;
}
.sidebar-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-bottom { padding: 1rem; border-top: 1px solid var(--border); }

.sidebar-user { display: flex; align-items: center; gap: .75rem; }

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}

.user-info { min-width: 0; }
.user-name { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logout-btn { color: var(--text-muted) !important; font-size: .88rem !important; padding: .5rem .75rem !important; text-decoration: none; }
.logout-btn:hover { color: #dc3545 !important; background: #fef2f2 !important; }

.dashboard-main { margin-left: 240px; flex: 1; padding: 2.5rem 2.5rem 3rem; max-width: 1200px; }

.dashboard-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem;
}

.dashboard-title { font-size: 1.65rem; font-weight: 700; color: var(--text); margin: 0 0 .3rem; letter-spacing: -.4px; }
.dashboard-subtitle { color: var(--text-muted); font-size: .9rem; margin: 0; }

.header-date {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: .45rem 1rem;
  font-size: .82rem; color: var(--text-muted); font-weight: 500; white-space: nowrap;
}

.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }

.program-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 1.25rem;
  transition: all .2s; position: relative; overflow: hidden;
}
.program-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,110,253,.03), transparent);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.program-card:hover { border-color: var(--primary); box-shadow: 0 8px 32px rgba(13,110,253,.12); transform: translateY(-2px); }
.program-card:hover::after { opacity: 1; }

.program-card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); flex-shrink: 0;
}

.program-card-body { flex: 1; }
.program-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0 0 .4rem; letter-spacing: -.2px; }
.program-desc { font-size: .85rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

.program-card-footer { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: auto; }
.program-launch { font-size: .85rem; font-weight: 600; color: var(--primary); }
.program-card:hover .program-launch { color: var(--primary-dark); }

.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-icon { width: 80px; height: 80px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); margin: 0 auto 1.5rem; }
.empty-state h2 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.empty-state p { color: var(--text-muted); font-size: .9rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-sidebar {
    width: 100%; position: static;
    border-right: none; border-bottom: 1px solid var(--border);
    flex-direction: row; flex-wrap: wrap; padding: 1rem; gap: .5rem;
  }
  .dashboard-main { margin-left: 0; padding: 1.5rem 1rem 2rem; }
  .sidebar-nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 0; }
  .dashboard-layout { flex-direction: column; }
  .sidebar-bottom { display: none; }
  .sidebar-brand { border: none; padding-bottom: 0; margin-bottom: 0; }
}

@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.5rem; }
  .program-grid { grid-template-columns: 1fr; }
}
