:root {
  --bg: #f3efe7;
  --bg-accent: #f8f6f1;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.62);
  --text: #1f2833;
  --text-soft: #5c6672;
  --primary: #0f766e;
  --primary-hover: #0b5f59;
  --primary-soft: rgba(15, 118, 110, 0.1);
  --secondary: #d97706;
  --secondary-hover: #b85d00;
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.1);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --border: rgba(31, 40, 51, 0.12);
  --shadow-lg: 0 28px 60px rgba(70, 46, 22, 0.16);
  --shadow-md: 0 18px 40px rgba(31, 40, 51, 0.12);
  --shadow-sm: 0 12px 24px rgba(31, 40, 51, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.18), transparent 32%),
    radial-gradient(circle at right center, rgba(15, 118, 110, 0.16), transparent 28%),
    linear-gradient(160deg, #f7f2e8 0%, #eff6f2 45%, #eef2f9 100%);
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  top: -90px;
  left: -100px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.28), transparent 70%);
  animation: drift 14s ease-in-out infinite;
}

.ambient-right {
  right: -80px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.26), transparent 68%);
  animation: drift 18s ease-in-out infinite reverse;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.shell-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: rise-in 0.5s ease both;
}

.card-body {
  padding: 32px;
}

.hero-grid,
.quiz-grid,
.contact-grid,
.crm-grid,
.details-grid {
  display: grid;
  gap: 24px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.quiz-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.contact-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
}

.crm-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

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

.panel,
.question-panel,
.sidebar-panel,
.metric-card,
.feedback-card,
.contact-card,
.empty-card,
.login-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel,
.question-panel,
.sidebar-panel,
.contact-card,
.login-card {
  padding: 24px;
}

.hero-tag,
.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-tag {
  color: var(--primary);
  background: var(--primary-soft);
}

.pill {
  color: var(--text-soft);
  background: rgba(31, 40, 51, 0.06);
}

.status-chip {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
}

.status-chip.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-chip.success {
  color: var(--success);
  background: var(--success-soft);
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.muted {
  color: var(--text-soft);
}

.feature-list,
.summary-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.feature-item,
.summary-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 118, 110, 0.06);
}

.summary-item {
  background: rgba(31, 40, 51, 0.05);
}

.form-grid,
.contact-form,
.login-form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-weight: 700;
  color: var(--text);
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  border: 1px solid rgba(31, 40, 51, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field-group textarea {
  min-height: 180px;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  line-height: 1.55;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.question-header,
.question-meta,
.section-head,
.table-head,
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.question-meta {
  margin-bottom: 24px;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 40, 51, 0.08);
  overflow: hidden;
  margin-top: 16px;
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #d97706);
  transition: width 0.35s ease;
}

.question-copy {
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.options-grid {
  display: grid;
  gap: 12px;
}

.option-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 40, 51, 0.12);
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.option-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(15, 118, 110, 0.28);
}

.option-card input {
  margin-top: 0;
  accent-color: var(--primary);
}

.option-card.correct-answer {
  border-color: rgba(21, 128, 61, 0.55);
  background: rgba(21, 128, 61, 0.06);
}

.option-card.wrong-answer {
  border-color: rgba(185, 28, 28, 0.45);
  background: rgba(185, 28, 28, 0.06);
}

.actions-row,
.toolbar-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.intro-start-row .btn {
  width: 100%;
}

.question-panel .actions-row {
  margin-top: 18px;
  gap: 16px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
  box-shadow: 0 16px 28px rgba(31, 40, 51, 0.12);
  position: relative;
  overflow: hidden;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #139087);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover), #0f766e);
}

.btn-secondary {
  color: #fff;
  background: linear-gradient(135deg, var(--secondary), #f08c1f);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--secondary-hover), #d97706);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border: 1px solid rgba(31, 40, 51, 0.12);
}

.btn-ghost:hover:not(:disabled) {
  background: #ffffff;
}

.btn.danger {
  color: #fff;
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.btn-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.btn-note {
  font-size: 0.86rem;
  opacity: 0.9;
}

.btn.is-countdown {
  padding-right: 18px;
}

.btn-countdown-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.42));
  animation-name: fill-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.feedback-card {
  margin-top: 20px;
  padding: 18px 20px;
}

.feedback-card.correct {
  border-color: rgba(21, 128, 61, 0.26);
  background: rgba(21, 128, 61, 0.07);
}

.feedback-card.wrong {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(185, 28, 28, 0.07);
}

.feedback-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 8px;
}

.timer-box,
.stage-box,
.score-box {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(31, 40, 51, 0.05);
}

.stage-box strong,
.score-box strong,
.timer-box strong {
  display: block;
  font-size: 1.05rem;
}

.timer-box {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(217, 119, 6, 0.09));
}

.timer-box.warning {
  background: rgba(185, 28, 28, 0.08);
}

.metric-grid {
  display: grid;
  gap: 14px;
}

.metric-card {
  padding: 18px 20px;
}

.metric-card .metric-label {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.metric-card .metric-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.contact-choices {
  display: grid;
  gap: 12px;
}

.contact-choice {
  border: 1px solid rgba(31, 40, 51, 0.12);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.contact-choice:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.contact-choice.active {
  border-color: rgba(15, 118, 110, 0.5);
  background: rgba(15, 118, 110, 0.07);
}

.contact-choice strong {
  display: block;
  margin-bottom: 4px;
}

.error-message {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.16);
}

.info-message {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary);
  border: 1px solid rgba(15, 118, 110, 0.15);
}

.empty-card {
  padding: 44px 24px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.crm-table {
  table-layout: fixed;
  min-width: 1040px;
}

.crm-table th,
.crm-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 40, 51, 0.08);
  vertical-align: top;
}

thead th {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: rgba(31, 40, 51, 0.04);
}

tbody tr {
  transition: background-color 0.16s ease;
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.04);
}

tbody tr.is-selected {
  background: rgba(15, 118, 110, 0.08);
}

.candidate-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.candidate-subline {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
}

.answer-item pre {
  white-space: pre-wrap;
  margin: 10px 0 0;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
}

.answer-item .question-copy {
  font-size: 0.96rem;
  margin-bottom: 10px;
}

.skeleton {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 40, 51, 0.08), rgba(31, 40, 51, 0.14), rgba(31, 40, 51, 0.08));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton.large {
  height: 22px;
}

.login-card {
  max-width: 480px;
  margin: 64px auto 0;
}

.footer-note {
  margin-top: 18px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.stack {
  display: grid;
  gap: 16px;
}

.hidden {
  display: none !important;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(24px, -18px, 0);
  }
}

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

@keyframes fill-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .quiz-grid,
  .contact-grid,
  .crm-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding-top: 28px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 18px 14px 36px;
  }

  .card-body,
  .panel,
  .question-panel,
  .sidebar-panel,
  .contact-card,
  .login-card {
    padding: 20px;
  }

  .actions-row,
  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .question-header,
  .question-meta,
  .section-head,
  .table-head,
  .detail-head {
    align-items: stretch;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .shell-card {
    border-radius: 22px;
  }

  .option-card {
    padding: 14px;
  }

  .field-group input,
  .field-group select,
  .field-group textarea {
    padding: 13px 14px;
  }
}
