:root {
  --purple: #4d2b84;
  --purple-base: #7852a8;
  --lilac: #b69ad3;
  --teal: #89d5cc;
  --green: #50a849;
  --green-dark: #166a10;
  --beige: #fcf7ee;
  --yellow: #ffc300;
  --ink: #26202f;
  --muted: #6c6475;
  --line: rgba(77, 43, 132, 0.16);
  --card: #ffffff;
  --shadow: 0 16px 42px rgba(55, 35, 86, 0.12);
  --radius: 22px;
  --font: "Urbanist", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(137, 213, 204, 0.28), transparent 30%),
    linear-gradient(180deg, var(--beige) 0%, #f7efff 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(100%, 440px);
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 164px;
  height: auto;
  margin-bottom: 18px;
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card h1 {
  color: var(--purple);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.02;
  font-weight: 900;
}

.login-copy {
  margin-top: 12px !important;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-message {
  min-height: 22px;
  margin-top: 14px !important;
  color: var(--purple);
  font-size: 14px;
  font-weight: 800;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 18px 56px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: rgba(252, 247, 238, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  backdrop-filter: blur(16px);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.brand img {
  width: 132px;
  height: auto;
}

.header-copy h1,
.header-copy p {
  margin: 0;
}

.header-copy h1 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
  color: var(--purple);
  line-height: 1.05;
}

.user-email {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--purple-base);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.hero,
.summary,
.panel {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 5vw, 46px);
  overflow: hidden;
}

.hero-content h2 {
  margin: 0 0 14px;
  max-width: 620px;
  color: var(--purple);
  font-size: clamp(30px, 5.4vw, 56px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -1px;
}

.hero-content p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  font-weight: 600;
}

.tag {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px !important;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(137, 213, 204, 0.42);
  font-size: 13px !important;
  font-weight: 900 !important;
}

.diagnostic-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--purple);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(77, 43, 132, 0.18);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple-base);
  box-shadow: 0 0 0 4px rgba(120, 82, 168, 0.12);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1.1;
}

.primary-button {
  padding: 16px 22px;
  color: #fff;
  background: var(--green);
  border-bottom: 5px solid var(--green-dark);
  box-shadow: 0 10px 22px rgba(80, 168, 73, 0.24);
}

.ghost-button {
  padding: 11px 16px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.small {
  padding: 12px 14px;
  font-size: 13px;
}

.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 22px;
}

.summary h2,
.summary p {
  margin: 0;
}

.summary h2 {
  color: var(--purple);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.08;
}

.summary p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 600;
  margin-top: 6px;
}

.score-card {
  display: grid;
  place-items: center;
  min-width: 124px;
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--purple);
  color: #fff;
  text-align: center;
}

.score-card strong {
  font-size: 32px;
  line-height: 1;
}

.score-card span {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.tabs {
  position: sticky;
  top: 88px;
  z-index: 15;
  display: flex;
  gap: 8px;
  margin: 18px 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 18px;
  background: rgba(77, 43, 132, 0.96);
  box-shadow: 0 12px 30px rgba(77, 43, 132, 0.16);
}

.tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.tab.is-active {
  color: var(--purple);
  background: var(--yellow);
}

.panel {
  display: none;
  padding: clamp(22px, 4vw, 34px);
}

.panel.is-active {
  display: block;
}

.section-head {
  max-width: 680px;
  margin: 0 0 24px;
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head h2 {
  color: var(--purple);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.05;
}

.section-head p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.today-grid,
.work-area,
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.qaf-card,
.check-card,
.timer-card,
.plan-day,
.method-card,
.topic-card,
.error-card,
.bonus-card {
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.qaf-card {
  padding: 18px;
}

.qaf-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 13px;
  color: #fff;
  background: var(--purple);
  font-size: 24px;
  font-weight: 900;
}

.qaf-a span {
  background: var(--green);
}

.qaf-f span {
  background: var(--teal);
  color: var(--purple);
}

.qaf-card h3,
.qaf-card p {
  margin: 0;
}

.qaf-card h3 {
  color: var(--purple);
  font-size: 20px;
  font-weight: 900;
}

.qaf-card p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.work-area {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  margin-top: 14px;
}

.check-card,
.timer-card {
  padding: 20px;
}

.check-card h3,
.timer-card h3 {
  margin: 0 0 14px;
  color: var(--purple);
  font-size: 20px;
  font-weight: 900;
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(252, 247, 238, 0.86);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.check-item input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--green);
}

.check-item:has(input:checked) {
  color: var(--muted);
  text-decoration: line-through;
}

.timer-display {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin-bottom: 14px;
  border-radius: 18px;
  color: var(--purple);
  background: linear-gradient(180deg, rgba(182, 154, 211, 0.2), rgba(137, 213, 204, 0.22));
  font-size: clamp(44px, 8vw, 66px);
  font-weight: 900;
  letter-spacing: -1px;
}

.timer-presets,
.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timer-presets button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--purple);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.timer-actions {
  margin-top: 10px;
}

.plan-list,
.methods-grid,
.topics-grid,
.error-list {
  display: grid;
  gap: 12px;
}

.plan-day {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px;
}

.plan-day__num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fff;
  background: var(--purple);
  font-size: 20px;
  font-weight: 900;
}

.plan-day h3,
.plan-day p {
  margin: 0;
}

.plan-day h3 {
  color: var(--purple);
  font-size: 18px;
  font-weight: 900;
}

.plan-day p {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.topic-progress {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(137, 213, 204, 0.24);
}

.topic-bar {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(77, 43, 132, 0.12);
}

.topic-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.25s ease;
}

.topic-progress p {
  margin: 8px 0 0;
  color: var(--purple);
  font-weight: 900;
}

.topics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-card {
  padding: 15px;
}

.topic-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--purple);
  font-size: 16px;
  font-weight: 900;
}

.method-card {
  padding: 18px;
}

.method-card h3,
.method-card p {
  margin: 0;
}

.method-card h3 {
  color: var(--purple);
  font-size: 20px;
  font-weight: 900;
}

.method-card p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.method-card button {
  margin-top: 14px;
}

.error-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.error-card {
  padding: 16px;
}

.error-card h3,
.error-card p {
  margin: 0;
}

.error-card h3 {
  color: var(--purple);
  font-size: 18px;
  font-weight: 900;
}

.error-card p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
}

.error-card small {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(255, 195, 0, 0.28);
  font-weight: 900;
}

.bonus-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bonus-card {
  padding: 22px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.bonus-card:hover {
  transform: translateY(-2px);
  border-color: var(--purple-base);
}

.bonus-card strong {
  display: block;
  color: var(--purple);
  font-size: 20px;
  font-weight: 900;
}

.bonus-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.video-bonus {
  margin-top: 16px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--purple);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}

.video-bonus iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 840px) {
  .hero,
  .summary,
  .work-area {
    grid-template-columns: 1fr;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .brand {
    display: none;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .tabs {
    top: 74px;
  }

  .today-grid,
  .topics-grid,
  .bonus-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px 10px 42px;
  }

  .app-header {
    border-radius: 16px;
  }

  .hero,
  .summary,
  .panel {
    border-radius: 18px;
  }

  .hero {
    padding: 22px;
  }

  .ghost-button {
    padding: 10px 12px;
    font-size: 12px;
  }
}
