:root {
  --white: #ffffff;
  --canvas: #f7f9fc;
  --gray-900: #1f2937;
  --gray-500: #6b7280;
  --gray-200: #e5e7eb;
  --blue: #20466b;
  --blue-strong: #173450;
  --blue-soft: rgba(32, 70, 107, 0.12);
  --orange: #f26e44;
  --orange-soft: rgba(242, 110, 68, 0.14);
  --orange-strong: #d85831;

  --radius-lg: 18px;
  --radius-md: 14px;
  --space-1: 0.4rem;
  --space-2: 0.6rem;
  --space-3: 0.9rem;
  --space-4: 1.1rem;
  --space-5: 1.4rem;
  --space-6: 1.8rem;
  --content-max: 68rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--gray-900);
  background:
    radial-gradient(circle at top right, rgba(242, 110, 68, 0.14), transparent 28%),
    linear-gradient(180deg, #fbfcfe 0%, var(--canvas) 100%);
}

#app {
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  margin: 0;
  min-height: 100vh;
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
}

.site-topbar-wrap {
  width: 100%;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.site-topbar {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.site-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.site-logo i {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.site-brand-text {
  display: grid;
  line-height: 1.1;
}

.site-brand-text strong {
  color: var(--gray-900);
  font-size: 0.95rem;
}

.site-brand-text span {
  color: var(--gray-500);
  font-size: 0.78rem;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(242, 110, 68, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--orange-strong);
  font-weight: 700;
  font-size: 0.88rem;
  background: rgba(242, 110, 68, 0.12);
  cursor: pointer;
}

.credit-pill i {
  width: 15px;
  height: 15px;
}

.credit-report {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.credit-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 70px 60px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-900);
}

.credit-row:first-child {
  border-top: 0;
}

.credit-row-head {
  font-weight: 700;
  color: var(--gray-500);
  background: var(--white);
}

.delta-negative {
  color: var(--orange);
  font-weight: 700;
}

.delta-positive {
  color: var(--gray-900);
  font-weight: 700;
}

.main-content {
  padding: 1rem 1rem 7.8rem;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

.dashboard-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.15;
  color: var(--gray-900);
}

.dashboard-subtitle {
  margin: 0.35rem 0 0;
  color: var(--gray-500);
  font-size: 0.95rem;
}

.new-class-btn {
  width: fit-content;
  min-height: 44px;
}

.app-header {
  padding: 1rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

.header-title {
  margin: 0;
  font-size: clamp(1.1rem, 2.3vw, 1.35rem);
  font-weight: 700;
  flex: 1;
  text-align: center;
  color: var(--gray-900);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--gray-900);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-placeholder {
  width: 40px;
  height: 40px;
  display: inline-block;
}

.icon-btn i,
.turma-icon i,
.spark i,
.notice i,
.option-btn .action i,
.simple-btn i,
.btn-inline i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.icon-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.option-btn:focus-visible,
.simple-btn:focus-visible,
.input:focus-visible {
  outline: 3px solid rgba(32, 70, 107, 0.28);
  outline-offset: 1px;
}

.progress-wrap {
  margin-bottom: 1rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--gray-900);
}

.progress-head strong {
  color: var(--orange);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.turma-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.turma-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.turma-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
}

.turma-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-500);
}

.section-title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.5rem, 2.8vw, 1.8rem);
  line-height: 1.2;
  color: var(--gray-900);
}

.theme-focus-title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.25rem, 2.4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--gray-900);
}

.label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gray-900);
}

.input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  background: var(--white);
  color: var(--gray-900);
  font-size: 1.08rem;
  padding: 0.95rem 1rem;
  box-shadow: 0 1px 2px rgba(32, 70, 107, 0.04);
}

.input::placeholder {
  color: var(--gray-500);
}

.textarea-input {
  min-height: 110px;
  resize: vertical;
  font-family: inherit;
}

.section-block {
  margin-top: 1.1rem;
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--gray-900);
}

.suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.suggestion-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--orange);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}

.link-action i {
  width: 15px;
  height: 15px;
}

.spark {
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cards-list {
  display: grid;
  gap: 0.68rem;
}

.cards-grid {
  display: grid;
  gap: 0.85rem;
}

.cards-grid--turmas .turma-card {
  margin-bottom: 0;
}

.turma-card--stack {
  display: block;
}

.turma-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.turma-meta {
  margin-bottom: 0.8rem;
}

.option-btn {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  background: var(--white);
  color: var(--gray-900);
  text-align: left;
  margin: 0;
  padding: 0.9rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.option-btn .bullet {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
  flex: 0 0 auto;
}

.option-btn .content {
  flex: 1;
}

.option-btn .title {
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.25;
}

.option-btn .code {
  display: inline-block;
  margin-bottom: 0.28rem;
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(242, 110, 68, 0.4);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
}

.option-btn .meta {
  margin-top: 0.35rem;
  color: var(--gray-500);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.option-btn .action {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.option-btn.active {
  border: 3px solid var(--blue);
  padding: calc(0.9rem - 2px) calc(0.95rem - 2px);
  background: rgba(32, 70, 107, 0.03);
}

.option-btn.active .action {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.notice {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  padding: 0.75rem 0.85rem;
  color: var(--gray-900);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.notice strong {
  color: var(--orange);
}

.notice.ok,
.notice.info {
  border-color: rgba(242, 110, 68, 0.28);
}

.notice i {
  color: var(--orange);
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--white);
  background: var(--orange);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  text-transform: uppercase;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.summary-panel {
  display: none;
}

.wizard-primary {
  min-width: 0;
}

.simple-btn {
  border: 2px dashed var(--gray-200);
  border-radius: 18px;
  width: 100%;
  padding: 0.86rem;
  background: var(--white);
  color: var(--orange);
  font-weight: 700;
  cursor: pointer;
}

.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--gray-200);
  padding: 0.8rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
  z-index: 10;
}

.footer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.btn-primary,
.btn-secondary {
  border: 0;
  border-radius: 999px;
  min-height: 50px;
  padding: 0.8rem 1.2rem;
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(32, 70, 107, 0.18);
}

.btn-primary:hover {
  background: var(--blue-strong);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.metric-card {
  justify-content: center;
}

.metric-value {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.text-center {
  text-align: center;
}

.mb-1 {
  margin-bottom: 1rem;
}

.loading-wrap {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--gray-900);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(32, 70, 107, 0.18);
  border-top-color: var(--orange);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 0.8rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 768px) {
  .app-shell {
    min-height: 100vh;
  }

  .main-content {
    padding: 1.35rem 1.5rem 1.5rem;
    max-width: var(--content-max);
    margin: 0 auto;
  }

  .site-topbar {
    max-width: var(--content-max);
    padding: 0.85rem 1.5rem;
  }

  .app-header {
    padding: 1rem 1.5rem 0.85rem;
    max-width: var(--content-max);
    width: 100%;
    margin: 0 auto;
  }

  .header-title {
    text-align: left;
    font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  }

  .icon-placeholder {
    display: none;
  }

  .wizard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: start;
  }

  .summary-panel {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 0.95rem;
    position: sticky;
    top: 1.5rem;
  }

  .summary-panel h3 {
    margin: 0 0 0.7rem;
    font-size: 1.06rem;
    color: var(--gray-900);
  }

  .summary-panel p {
    margin: 0.3rem 0;
    color: var(--gray-500);
    font-size: 0.9rem;
  }

  .footer-bar {
    position: sticky;
    left: 0;
    bottom: 0;
    max-width: none;
    margin-top: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0.9rem 1.5rem 1rem;
  }

  .footer-actions {
    grid-template-columns: 1fr;
    max-width: var(--content-max);
    margin: 0 auto;
  }

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

  .suggestion-header {
    gap: 1rem;
  }

  .dashboard-head {
    grid-template-columns: 1fr auto;
    align-items: end;
    margin-bottom: 1.15rem;
  }

}

@media (min-width: 1180px) {
  .wizard-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.2rem;
  }

  .section-title {
    font-size: clamp(1.6rem, 1.8vw, 2rem);
  }

  .cards-grid--turmas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}
