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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: #0A6E6E;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ─── Device Frame ─── */
.device {
  width: 402px;
  height: 874px;
  background: #FEFCF8;
  border-radius: 48px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 12px #1a1a1a,
    0 0 0 14px #333,
    0 40px 80px rgba(0,0,0,0.4),
    0 80px 160px rgba(0,0,0,0.15);
}

.device-notch {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 24px;
  z-index: 50;
}

.device-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.device-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 139px;
  height: 5px;
  background: rgba(0,0,0,0.25);
  border-radius: 100px;
  z-index: 60;
}

/* ─── Status Bar ─── */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 8px;
  position: relative;
  z-index: 10;
}

.status-time {
  font-size: 17px;
  font-weight: 590;
  letter-spacing: -0.3px;
  color: #000;
  font-family: -apple-system, 'SF Pro', system-ui;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Screen Container ─── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen.active {
  display: flex;
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 100px;
  -webkit-overflow-scrolling: touch;
}

.screen-scroll::-webkit-scrollbar { display: none; }

/* ─── Typography ─── */
.text-primary { color: #0A6E6E; }

/* ─── Alert Banner ─── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FDEDEC;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 4px 0 16px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.alert-banner:active { transform: scale(0.98); }

.alert-dot {
  width: 8px;
  height: 8px;
  background: #E53935;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-text {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #C0392B;
}

.alert-chevron {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ─── Greeting ─── */
.greeting {
  margin-bottom: 20px;
}

.greeting-date {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.greeting-title {
  font-size: 34px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

/* ─── Goal Card ─── */
.goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #E8F5F0;
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.goal-card:active { transform: scale(0.98); }

.goal-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.goal-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  color: #0A6E6E;
}

.goal-info {
  flex: 1;
}

.goal-label {
  font-size: 11px;
  font-weight: 700;
  color: #0A6E6E;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.goal-text {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.goal-chevron {
  flex-shrink: 0;
  opacity: 0.4;
}

/* ─── Section Title ─── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ─── Scam Card ─── */
.scam-card {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
}

.scam-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.scam-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FDEDEC;
  color: #E53935;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 100px;
}

.scam-badge-dot {
  width: 6px;
  height: 6px;
  background: #E53935;
  border-radius: 50%;
}

.scam-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-text {
  font-size: 13px;
  font-weight: 700;
  color: #0A6E6E;
  margin-top: -4px;
}

.logo-think {
  color: #3A8B8B;
  font-weight: 400;
}

.scam-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  margin-bottom: 12px;
}

.scam-desc {
  font-size: 15px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 20px;
}

.scam-desc strong {
  color: #1a1a1a;
}

/* ─── Buttons ─── */
.btn-primary {
  width: 100%;
  height: 54px;
  background: #0A6E6E;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.btn-primary:active {
  transform: scale(0.98);
  background: #085858;
}

.btn-full {
  margin-top: 8px;
  margin-bottom: 20px;
}

/* ─── Page Title ─── */
.page-title {
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 16px 0 20px;
  letter-spacing: -0.5px;
}

/* ─── Member Card ─── */
.member-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.03);
}

.member-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
}

.member-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.member-role {
  font-size: 13px;
  color: #888;
  margin-top: 1px;
}

.member-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-percent {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}

.stat-percent--good {
  background: #E8F5F0;
  color: #0A6E6E;
}

.stat-percent--bad {
  background: #FDEDEC;
  color: #C0392B;
}

.stat-fraction {
  font-size: 14px;
  font-weight: 700;
  color: #0A6E6E;
  background: #E8F5F0;
  padding: 4px 10px;
  border-radius: 100px;
}

/* ─── Skills ─── */
.member-skills {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px 40px;
  align-items: center;
  gap: 8px;
}

.skill-name {
  font-size: 13px;
  color: #666;
  line-height: 1.3;
}

.skill-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 100px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.5s ease;
}

.skill-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
}

.dot.active {
  background: #2E7D32;
}

.skill-value {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* ─── Alert Card ─── */
.alert-card {
  display: flex;
  gap: 14px;
  background: #E8F5F0;
  border-radius: 20px;
  padding: 18px;
  margin-top: 4px;
  margin-bottom: 20px;
}

.alert-card-icon {
  flex-shrink: 0;
}

.alert-card-content {
  flex: 1;
}

.alert-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0A6E6E;
  margin-bottom: 4px;
}

.alert-card-text {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

/* ─── Quiz Screen ─── */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
  position: relative;
  z-index: 10;
}

.quiz-back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quiz-dot {
  width: 24px;
  height: 4px;
  border-radius: 100px;
  background: #ddd;
}

.quiz-dot.active {
  background: #0A6E6E;
}

.quiz-level {
  font-size: 10px;
  font-weight: 700;
  color: #0A6E6E;
  background: #FFF8E1;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(10,110,110,0.15);
}

.quiz-meta {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.quiz-question {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 24px;
}

/* ─── Quiz Options ─── */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1.5px solid #eee;
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.quiz-option:hover {
  border-color: #ccc;
}

.quiz-option.selected {
  border-color: #0A6E6E;
  background: #F0FAF8;
}

.quiz-option.correct {
  border-color: #0A6E6E;
  background: #E8F5F0;
}

.quiz-option.wrong {
  border-color: #C0392B;
  background: #FDEDEC;
}

.quiz-option .option-wrong {
  display: none;
  flex-shrink: 0;
}

.quiz-option.wrong .option-wrong {
  display: block;
}

.quiz-option.wrong .option-letter {
  background: #C0392B;
  color: #fff;
  border-color: #C0392B;
}

.quiz-option.correct .option-check {
  display: block;
}

.quiz-option:not(.correct) .option-check {
  display: none;
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
  border: 1.5px solid #eee;
}

.quiz-option.correct .option-letter {
  background: #0A6E6E;
  color: #fff;
  border-color: #0A6E6E;
}

.option-text {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.option-check {
  flex-shrink: 0;
}

/* ─── Quiz Feedback ─── */
.quiz-feedback {
  background: #E8F5F0;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.feedback-title {
  font-size: 16px;
  font-weight: 700;
  color: #0A6E6E;
}

.feedback-text {
  font-size: 14px;
  line-height: 1.55;
  color: #555;
}

.feedback-text strong {
  color: #1a1a1a;
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 8px 0 28px;
  z-index: 40;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #999;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 20px;
  transition: color 0.15s ease;
  font-family: inherit;
}

.nav-item.active {
  color: #0A6E6E;
}

.nav-item svg {
  stroke-width: 2;
}

/* ─── Responsive ─── */
@media (max-width: 440px) {
  body { background: #FEFCF8; }
  #app { padding: 0; }
  .device {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .device-notch,
  .device-home-bar {
    display: none;
  }
  .status-bar {
    padding-top: 8px;
  }
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger only direct structural children, not quiz options */
.screen.active .screen-scroll > .alert-banner,
.screen.active .screen-scroll > .greeting,
.screen.active .screen-scroll > .goal-card,
.screen.active .screen-scroll > .section-title,
.screen.active .screen-scroll > .scam-card,
.screen.active .screen-scroll > .member-card,
.screen.active .screen-scroll > .alert-card,
.screen.active .screen-scroll > .page-title,
.screen.active .screen-scroll > .lesson-list,
.screen.active .screen-scroll > .quiz-meta,
.screen.active .screen-scroll > .quiz-question,
.screen.active .screen-scroll > .quiz-options,
.screen.active .screen-scroll > .quiz-feedback,
.screen.active .screen-scroll > .btn-primary {
  animation: fadeIn 0.35s ease both;
}

/* Stagger children */
.screen.active .screen-scroll > *:nth-child(1) { animation-delay: 0.02s; }
.screen.active .screen-scroll > *:nth-child(2) { animation-delay: 0.06s; }
.screen.active .screen-scroll > *:nth-child(3) { animation-delay: 0.10s; }
.screen.active .screen-scroll > *:nth-child(4) { animation-delay: 0.14s; }
.screen.active .screen-scroll > *:nth-child(5) { animation-delay: 0.18s; }
.screen.active .screen-scroll > *:nth-child(6) { animation-delay: 0.22s; }

/* ─── Embedded (iframe) mode ─── */
body.embedded {
  background: #FEFCF8;
}
body.embedded #app {
  padding: 0;
  min-height: 100vh;
}
body.embedded .device {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}
body.embedded .device-notch,
body.embedded .device-home-bar {
  display: none;
}
body.embedded .status-bar {
  padding-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Quiz Container ─── */
#quiz-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#quiz-container .screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 100px;
  -webkit-overflow-scrolling: touch;
}

/* ─── Lessons Screen ─── */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.lesson-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.03);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
}

.lesson-card:active {
  transform: scale(0.98);
}

.lesson-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lesson-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FDEDEC;
  color: #E53935;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 100px;
}

.lesson-level {
  font-size: 10px;
  font-weight: 700;
  color: #0A6E6E;
  background: #FFF8E1;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(10,110,110,0.15);
}

.lesson-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 6px;
}

.lesson-card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  margin-bottom: 14px;
}

.lesson-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lesson-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
}
