:root {
  --bg: #f5f1e8;
  --bg-soft: #fbf8f1;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: #fffdf8;
  --line: rgba(78, 59, 42, 0.14);
  --text: #2d261f;
  --muted: #6c5d4d;
  --accent: #3f6b45;
  --accent-strong: #24412c;
  --accent-soft: #d9e6cf;
  --warm: #b06a2b;
  --warm-soft: #f4dfc4;
  --danger: #a44938;
  --danger-soft: #f7ddd8;
  --shadow: 0 18px 45px rgba(61, 46, 32, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(176, 106, 43, 0.12), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(63, 107, 69, 0.16), transparent 20rem),
    linear-gradient(180deg, #f7f3eb 0%, #efe6d8 100%);
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.hidden,
.hidden-role {
  display: none !important;
}

.site-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
legend {
  font-family: Georgia, "Times New Roman", serif;
}

h1,
h2,
h3,
p,
ul {
  margin-top: 0;
}

.auth-view,
.app-view {
  display: grid;
  gap: 1.25rem;
}

.hero-card,
.auth-card,
.profile-card,
.panel-card,
.content-panel,
.session-badge {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card,
.auth-card,
.content-panel,
.panel-card,
.profile-card {
  padding: 1.35rem;
}

.hero-card h1,
.app-header h1 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.95;
}

.hero-text,
.panel-copy,
.profile-note,
.timeline p,
.list-stack li {
  color: var(--muted);
  line-height: 1.55;
}

.hero-grid,
.content-grid,
.stats-grid,
.card-grid {
  display: grid;
  gap: 1rem;
}

.mini-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
}

.mini-card ul,
.demo-card ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
}

.auth-card {
  align-content: start;
}

.auth-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  width: 100%;
  padding: 0.35rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(63, 107, 69, 0.08);
}

.switch-button,
.nav-button,
.secondary-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.switch-button,
.nav-button,
.secondary-button {
  padding: 0.8rem 1rem;
  background: transparent;
  color: var(--text);
}

.switch-button.is-active,
.nav-button.is-active {
  background: var(--accent);
  color: #f7f5ef;
}

.primary-button {
  padding: 0.85rem 1.1rem;
  background: var(--warm);
  color: #fff8f2;
  font-weight: 700;
}

.secondary-button {
  padding: 0.85rem 1.15rem;
  background: rgba(63, 107, 69, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.switch-button:hover,
.nav-button:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.auth-form {
  display: none;
}

.auth-form.is-active {
  display: block;
}

fieldset {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

legend {
  padding: 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

label {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(63, 107, 69, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(176, 106, 43, 0.22);
  border-color: var(--warm);
}

.feedback {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.feedback.success {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.feedback.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.demo-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(63, 107, 69, 0.09), rgba(176, 106, 43, 0.12));
}

.app-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.header-actions {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.session-badge {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
}

.session-badge span {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-grid {
  display: grid;
  gap: 1.25rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.profile-card h2 {
  margin-bottom: 0.45rem;
  font-size: 1.7rem;
}

.profile-role {
  margin-bottom: 0.4rem;
  color: var(--warm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-nav {
  display: grid;
  gap: 0.6rem;
}

.nav-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(63, 107, 69, 0.12);
  background: rgba(255, 255, 255, 0.65);
}

.panel-stack {
  display: grid;
}

.content-panel {
  display: none;
  gap: 1rem;
}

.content-panel.is-active {
  display: grid;
}

.panel-head,
.section-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-head h2,
.section-head h3 {
  margin-bottom: 0.35rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.stat-card strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.8rem;
  font-family: Georgia, "Times New Roman", serif;
}

.stat-card span {
  color: var(--muted);
}

.panel-card {
  height: 100%;
}

.chip-list,
.list-stack,
.timeline {
  display: grid;
  gap: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(63, 107, 69, 0.1);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 0.95rem;
  margin: 0.8rem 0 0.9rem;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--accent);
}

.list-stack,
.timeline {
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline-item,
.list-item,
.point-card,
.reward-card,
.code-card {
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.timeline-item strong,
.list-item strong,
.point-card h3,
.reward-card h3 {
  display: block;
  margin-bottom: 0.35rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.point-card {
  display: grid;
  gap: 0.85rem;
}

.point-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta-row span {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(176, 106, 43, 0.12);
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 700;
}

details {
  border-top: 1px dashed rgba(63, 107, 69, 0.16);
  padding-top: 0.65rem;
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.reward-card {
  display: grid;
  gap: 0.7rem;
}

.reward-card button {
  width: 100%;
}

.reward-card button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.code-card {
  display: grid;
  gap: 0.35rem;
}

.code-card strong {
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}

.preview-body {
  display: grid;
  gap: 0.8rem;
}

.preview-body img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.empty-state {
  padding: 1rem;
  border: 1px dashed rgba(63, 107, 69, 0.2);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

@media (min-width: 780px) {
  .auth-view {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }

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

@media (min-width: 980px) {
  .app-grid {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 779px) {
  .app-header,
  .panel-head,
  .section-head,
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

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