@import url('portal-theme.css');

.loading.hidden { display: none !important; }
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--aic-silver) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-block { height: 76px; border-radius: var(--radius); margin-bottom: 12px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.courses-loading { padding: 8px 0; }

/* Auth gate (signed out) */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  background: #fff;
}
.auth-panel-brand { margin-bottom: 32px; }
.auth-panel-brand img { height: 42px; width: auto; }
.auth-panel-brand span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 14px;
}
.auth-panel h1 {
  font-family: var(--font-h);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 14px;
}
.auth-panel .lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 28px;
}
.auth-features {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-bottom: 32px;
  max-width: 420px;
}
.auth-features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.auth-features svg { flex-shrink: 0; margin-top: 2px; color: var(--purple); }
.auth-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(163, 35, 142, 0.28);
}
.btn-outline:hover,
.btn.btn-outline:hover {
  background: #fff;
  color: var(--purple-deep);
  border-color: var(--purple);
  box-shadow: 0 4px 12px rgba(163, 35, 142, 0.12);
}
.auth-links { margin-top: 24px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.auth-links a { color: var(--purple); font-weight: 600; }
.auth-visual {
  background: linear-gradient(145deg, var(--purple-deep) 0%, var(--purple) 100%);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--gold);
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
}
.auth-visual-inner { position: relative; z-index: 1; color: #fff; max-width: 400px; }
.auth-visual .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.auth-visual h2 {
  font-family: var(--font-h);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 16px;
}
.auth-visual p {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 28px;
}
.auth-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.auth-stat {
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  text-align: center;
}
.auth-stat strong { display: block; font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.auth-stat span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
}

.page-banner-inner { max-width: 960px; }
.alert-info { background: var(--purple-pale); color: var(--purple-deep); border: 1px solid var(--purple-faint); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(26, 51, 86, 0.04);
}
.stat-card .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft);
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.15;
}
.stat-card .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.quick {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.quick:hover {
  border-color: rgba(201, 168, 76, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-pale);
  color: var(--purple);
  flex-shrink: 0;
}
.quick-icon svg { width: 22px; height: 22px; }
.quick strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--heading); }
.quick span { font-size: 12px; color: var(--muted); line-height: 1.45; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.card h2 { font-size: 17px; font-weight: 700; color: var(--heading); margin: 0; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.55; max-width: 520px; }

.steps { display: grid; gap: 0; margin-bottom: 28px; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-pale);
  color: var(--purple);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step.done .step-num {
  background: #ecfdf5;
  color: #059669;
  font-size: 16px;
}
.step h3 { font-size: 14px; font-weight: 700; color: var(--heading); margin-bottom: 4px; }
.step p { font-size: 13px; color: var(--muted); line-height: 1.55; }

.course-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--bg), #fff);
  transition: border-color 0.15s;
}
.course-card:last-child { margin-bottom: 0; }
.course-card:hover { border-color: var(--purple-faint); }
.course-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.course-title { font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--heading); }
.badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-pay { background: var(--purple-pale); color: var(--purple-deep); }
.badge-active { background: #ecfdf5; color: #065f46; }
.badge-review { background: var(--purple-pale); color: var(--purple); }
.course-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.course-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--purple-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.help-panel {
  background: linear-gradient(135deg, #f7f9fc, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.help-panel h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-panel p, .help-panel li { font-size: 13px; color: var(--muted); line-height: 1.65; }
.help-panel ul { margin: 10px 0 0 18px; }
.help-panel a { color: var(--heading); font-weight: 600; }
.help-panel a:hover { text-decoration: underline; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.profile-item {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.profile-item .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--soft);
  margin-bottom: 4px;
}
.profile-item .val { font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-word; }

/* Student introduction video */
.intro-video-wrap { margin-top: 4px; }
.intro-video-stage {
  position: relative;
  background: #0f1419;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-width: 640px;
}
.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.intro-video:not(.hidden) { display: block; }
.intro-video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.55;
}
.intro-video-placeholder svg { width: 48px; height: 48px; opacity: 0.7; }
.intro-recording-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.intro-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: intro-pulse 1s ease-in-out infinite;
}
@keyframes intro-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.intro-timer { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: 0.9; }
.intro-timer--warn { color: #fbbf24; }
.intro-video-actions { margin-top: 16px; max-width: 640px; }
.intro-confirm-block {
  margin-top: 16px;
  max-width: 640px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--purple-pale), #fff);
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(163, 35, 142, 0.1);
}
.intro-confirm-block.hidden { display: none !important; }
.intro-confirm-heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-deep);
}
.intro-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  cursor: pointer;
}
.intro-confirm-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 2px 0 0;
  accent-color: var(--purple);
  cursor: pointer;
  -webkit-appearance: checkbox;
  appearance: auto;
}
.intro-confirm-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}
.intro-video-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.intro-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.intro-hint { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.intro-privacy { margin-top: 14px; max-width: 640px; }
[data-intro-phase].hidden { display: none !important; }
.intro-video.hidden { display: none !important; }
.intro-video-placeholder.hidden { display: none !important; }

/* Next-step guide (post-login tour) */
.next-step-guide {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--purple-pale) 100%);
  border: 2px solid var(--purple);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(163, 35, 142, 0.15);
  position: relative;
  z-index: 6;
}
.next-step-guide.hidden { display: none !important; }
.next-step-guide__pulse {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--purple);
  animation: next-step-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes next-step-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(163, 35, 142, 0.5); }
  50% { opacity: 0.5; transform: scale(1.15); box-shadow: 0 0 0 8px rgba(163, 35, 142, 0); }
}
.next-step-guide__content { flex: 1; min-width: 200px; }
.next-step-guide__label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-deep);
}
.next-step-guide__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 500;
}
.next-step-guide__dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.next-step-guide__dismiss:hover {
  background: rgba(163, 35, 142, 0.08);
  color: var(--purple-deep);
}
.next-step-highlight {
  position: relative;
  z-index: 3;
  animation: next-step-border-pulse 1.4s ease-in-out infinite;
  outline: none;
}
.card.next-step-highlight,
.course-card.next-step-highlight {
  border: 2px solid var(--purple) !important;
  box-shadow: 0 0 0 4px rgba(163, 35, 142, 0.12), 0 12px 32px rgba(114, 34, 100, 0.14);
}
@keyframes next-step-border-pulse {
  0%, 100% {
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 4px rgba(163, 35, 142, 0.2), 0 0 20px rgba(163, 35, 142, 0.25);
  }
  50% {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15), 0 0 8px rgba(201, 168, 76, 0.2);
  }
}
.meta { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 12px; }
.page-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.page-footer a { color: var(--heading); font-weight: 600; }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 40px 28px; }
  .grid-2 { grid-template-columns: 1fr; }
}
