/* ============================
   Learnzy Performance Audit
   /reflect — Self-Assessment
   ============================ */

/* --- Design Tokens (matching main site) --- */
:root {
  --rf-bg: #0a0a0a;
  --rf-surface: rgba(255, 255, 255, 0.04);
  --rf-surface-hover: rgba(255, 255, 255, 0.08);
  --rf-surface-active: rgba(242, 109, 33, 0.12);
  --rf-border: rgba(255, 255, 255, 0.08);
  --rf-border-active: rgba(242, 109, 33, 0.5);
  --rf-text: #f5f2ef;
  --rf-text-muted: rgba(245, 242, 239, 0.5);
  --rf-orange: #f26d21;
  --rf-orange-glow: rgba(242, 109, 33, 0.25);
  --rf-green: #4da66a;
  --rf-red: #d85f4f;
  --rf-radius: 16px;
  --rf-radius-sm: 12px;
  --rf-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --rf-max-w: 480px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body.rf-body {
  min-height: 100%;
  background: var(--rf-bg);
  color: var(--rf-text);
  position: relative;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Hero Video Background --- */
.rf-video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.rf-video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rf-video-bg__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* --- Shell --- */
.rf-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--rf-max-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

/* --- Progress Bar --- */
.rf-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.06);
}

.rf-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rf-orange), #ff9a56);
  border-radius: 0 4px 4px 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--rf-orange-glow);
}

/* --- Header --- */
.rf-header {
  padding: 24px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.rf-header__logo-link {
  display: flex;
  align-items: center;
  height: 36px;
  overflow: visible;
  text-decoration: none;
}

.rf-header__logo {
  height: 100px;
  width: auto;
  max-width: none;
  opacity: 0.95;
}

.rf-header__time {
  font-size: 13px;
  color: var(--rf-text-muted);
  letter-spacing: 0.02em;
}

/* --- Slide Container --- */
.rf-slides {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.rf-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity var(--rf-transition), transform var(--rf-transition);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rf-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.rf-slide.is-prev {
  opacity: 0;
  transform: translateX(-60px);
  pointer-events: none;
}

/* --- Section Badge --- */
.rf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rf-orange);
  margin-bottom: 16px;
  width: fit-content;
}

.rf-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rf-orange);
}

/* --- Question --- */
.rf-question {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 28px;
  color: var(--rf-text);
}

.rf-question--sm {
  font-size: 18px;
  font-weight: 500;
}

.rf-subtitle {
  font-size: 14px;
  color: var(--rf-text-muted);
  margin-top: -20px;
  margin-bottom: 24px;
}

/* --- MCQ Options --- */
.rf-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.rf-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--rf-surface);
  border: 1.5px solid var(--rf-border);
  border-radius: var(--rf-radius-sm);
  cursor: pointer;
  transition: all var(--rf-transition);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.rf-option:hover {
  background: var(--rf-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.rf-option.is-selected {
  background: var(--rf-surface-active);
  border-color: var(--rf-border-active);
}

.rf-option.is-selected .rf-option__radio {
  border-color: var(--rf-orange);
  background: var(--rf-orange);
  box-shadow: inset 0 0 0 3px var(--rf-bg);
}

.rf-option.is-selected .rf-option__check {
  border-color: var(--rf-orange);
  background: var(--rf-orange);
}

.rf-option.is-selected .rf-option__check::after {
  opacity: 1;
}

.rf-option__radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all var(--rf-transition);
}

.rf-option__check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all var(--rf-transition);
  position: relative;
}

.rf-option__check::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
}

.rf-option__text {
  flex: 1;
}

/* Multi-select limit reached */
.rf-option.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* --- Slider (Stress) --- */
.rf-slider-container {
  padding: 20px 0;
}

.rf-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--rf-text-muted);
  margin-bottom: 16px;
}

.rf-slider-value {
  text-align: center;
  font-size: 56px;
  font-weight: 700;
  color: var(--rf-orange);
  margin-bottom: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rf-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.rf-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rf-orange);
  cursor: pointer;
  box-shadow: 0 2px 10px var(--rf-orange-glow);
  border: 3px solid var(--rf-bg);
}

.rf-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rf-orange);
  cursor: pointer;
  box-shadow: 0 2px 10px var(--rf-orange-glow);
  border: 3px solid var(--rf-bg);
}

/* --- Text Input (Reflection) --- */
.rf-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  background: var(--rf-surface);
  border: 1.5px solid var(--rf-border);
  border-radius: var(--rf-radius-sm);
  color: var(--rf-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color var(--rf-transition);
}

.rf-textarea:focus {
  border-color: var(--rf-border-active);
}

.rf-textarea::placeholder {
  color: var(--rf-text-muted);
}

.rf-char-count {
  text-align: right;
  font-size: 13px;
  color: var(--rf-text-muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.rf-char-count.is-limit {
  color: var(--rf-red);
}

/* --- Navigation Buttons --- */
.rf-nav {
  display: flex;
  gap: 12px;
  padding: 20px 0 40px;
  flex-shrink: 0;
}

.rf-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--rf-radius-sm);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--rf-transition);
  -webkit-tap-highlight-color: transparent;
}

.rf-btn--back {
  background: var(--rf-surface);
  border: 1.5px solid var(--rf-border);
  color: var(--rf-text);
  flex: 0 0 auto;
  padding: 16px 24px;
}

.rf-btn--back:hover {
  background: var(--rf-surface-hover);
}

.rf-btn--next {
  background: linear-gradient(135deg, var(--rf-orange), #e05a10);
  color: white;
  box-shadow: 0 4px 20px var(--rf-orange-glow);
}

.rf-btn--next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--rf-orange-glow);
}

.rf-btn--next:disabled {
  opacity: 0.35;
  pointer-events: none;
  transform: none;
}

.rf-btn--generate {
  background: linear-gradient(135deg, var(--rf-orange), #e05a10);
  color: white;
  box-shadow: 0 4px 20px var(--rf-orange-glow);
  padding: 18px;
  font-size: 16px;
}

.rf-btn--generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--rf-orange-glow);
}

/* --- Intro Slide --- */
.rf-intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rf-intro__icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.rf-intro__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

.rf-intro__title em {
  font-style: normal;
  color: var(--rf-orange);
}

.rf-intro__desc {
  font-size: 15px;
  color: var(--rf-text-muted);
  line-height: 1.6;
  max-width: 340px;
}

.rf-intro__meta {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.rf-intro__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--rf-text-muted);
}

.rf-intro__meta-item span {
  font-size: 16px;
}

.rf-btn--start {
  margin-top: 12px;
  width: 100%;
  max-width: 300px;
}

/* --- Loading Overlay --- */
.rf-loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--rf-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.rf-loading.is-active {
  opacity: 1;
  pointer-events: auto;
}

.rf-loading__lines {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
}

.rf-loading__line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--rf-text-muted);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s, color 0.3s;
}

.rf-loading__line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rf-loading__line.is-done {
  color: var(--rf-green);
}

.rf-loading__check {
  opacity: 0;
  transition: opacity 0.3s;
  color: var(--rf-green);
}

.rf-loading__line.is-done .rf-loading__check {
  opacity: 1;
}

/* --- Result Screen --- */
.rf-result {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.rf-result__icon {
  font-size: 56px;
  animation: rf-pulse 2s ease-in-out infinite;
}

@keyframes rf-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.rf-result__title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.rf-result__desc {
  font-size: 14px;
  color: var(--rf-text-muted);
  line-height: 1.6;
  max-width: 320px;
}

.rf-result__steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  margin: 4px 0 8px;
}

.rf-result__step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-sm);
  text-align: left;
}

.rf-result__step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rf-orange), #e05a10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.rf-result__step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rf-result__step-text strong {
  font-size: 14px;
  color: var(--rf-text);
}

.rf-result__step-text span {
  font-size: 12px;
  color: var(--rf-text-muted);
}

.rf-result__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
}

.rf-btn--copy {
  background: linear-gradient(135deg, var(--rf-orange), #e05a10);
  color: white;
  box-shadow: 0 4px 20px var(--rf-orange-glow);
  padding: 18px;
  font-size: 16px;
  border: none;
  border-radius: var(--rf-radius-sm);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--rf-transition);
}

.rf-btn--copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--rf-orange-glow);
}

.rf-btn--copy.is-copied {
  background: linear-gradient(135deg, var(--rf-green), #3a8c55);
  box-shadow: 0 4px 20px rgba(77, 166, 106, 0.25);
}

.rf-btn--download {
  background: var(--rf-surface);
  border: 1.5px solid var(--rf-border);
  color: var(--rf-text);
  padding: 16px;
  font-size: 15px;
  border-radius: var(--rf-radius-sm);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--rf-transition);
  text-decoration: none;
  text-align: center;
}

.rf-btn--download:hover {
  background: var(--rf-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.rf-result__hint {
  font-size: 12px;
  color: var(--rf-text-muted);
  margin-top: 4px;
}

/* --- Ambient Glow (decorative) --- */
.rf-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rf-orange-glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}

.rf-glow--top {
  top: -100px;
  right: -100px;
}

.rf-glow--bottom {
  bottom: -100px;
  left: -100px;
}

/* --- Responsive --- */
@media (min-width: 600px) {
  .rf-shell {
    padding: 0 32px;
  }
  .rf-question {
    font-size: 26px;
  }
  .rf-intro__title {
    font-size: 34px;
  }
}
