/* ==========================================================================
   OFFER SCORECARD & CANVAS - DESIGN SYSTEM
   Tác giả: Đỗ Chí Dũng (dochidung.com)
   ========================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg-page: #FAF8F5;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F6F4EE;
  
  --color-text-main: #1C1917;
  --color-text-muted: #78716C;
  --color-text-light: #A8A29E;
  
  --color-primary: #15803D; /* Xanh lá chuyển đổi / uy tín */
  --color-primary-hover: #166534;
  --color-primary-light: #DCFCE7;
  
  --color-accent: #D97706; /* Vàng hổ phách Hormozi */
  --color-accent-light: #FEF3C7;
  
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;

  --border-color: #E7E2D9;
  --border-subtle: #F0ECE4;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px -2px rgba(28, 25, 23, 0.06), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(28, 25, 23, 0.08), 0 4px 10px -2px rgba(28, 25, 23, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Brand */
.header {
  padding: 36px 0 20px;
  text-align: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #44403C;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.brand-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  color: #0C0A09;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.title span {
  background: linear-gradient(135deg, #15803D 0%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}

/* Tab Switcher */
.tab-container {
  display: flex;
  background-color: #EDE8E0;
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn.active {
  background-color: #FFFFFF;
  color: #0C0A09;
  box-shadow: var(--shadow-sm);
}

/* Main Form Card */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #292524;
  margin-bottom: 8px;
}

.input-text, .select-input, .textarea-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  background-color: #FCFBF9;
  color: #1C1917;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-text:focus, .select-input:focus, .textarea-input:focus {
  border-color: var(--color-primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.12);
}

.textarea-input {
  min-height: 100px;
  resize: vertical;
}

.input-hint {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* Button */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: #15803D;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #166534;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(21, 128, 61, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Quiz questions style */
.quiz-item {
  background-color: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.quiz-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1C1917;
  margin-bottom: 4px;
}

.quiz-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.scale-options {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.scale-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid var(--border-color);
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scale-btn:hover {
  border-color: var(--color-primary);
}

.scale-btn.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
}

/* Loading Overlay */
.loading-box {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #E7E2D9;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.step-indicator {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  min-height: 22px;
  margin-top: 10px;
}

/* Teaser Results Screen */
.result-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.score-overview-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}

.source-url-pill {
  display: inline-block;
  font-size: 13px;
  color: var(--color-text-muted);
  background: #F5F3EF;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  word-break: break-all;
}

.score-number {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: #0C0A09;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.score-max {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.score-level-badge {
  display: inline-block;
  margin: 14px 0 10px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.badge-excellent { background: #DCFCE7; color: #166534; }
.badge-good { background: #FEF3C7; color: #B45309; }
.badge-weak { background: #FEE2E2; color: #B91C1C; }

.score-summary-text {
  font-size: 14.5px;
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* Issues section */
.section-heading {
  font-size: 20px;
  font-weight: 800;
  color: #1C1917;
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.issue-tag {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.issue-priority {
  font-size: 12px;
  font-weight: 600;
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.issue-title {
  font-size: 16px;
  font-weight: 700;
  color: #1C1917;
  margin-bottom: 6px;
}

.issue-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.issue-action {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 13.5px;
  color: #15803D;
  font-weight: 600;
}

/* Lead Capture Gate Card */
.lead-gate-card {
  background: #FFFFFF;
  border: 2px solid #15803D;
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-top: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.lead-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #15803D, #D97706);
}

.gate-title {
  font-size: 20px;
  font-weight: 800;
  color: #0C0A09;
  margin-bottom: 6px;
}

.gate-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.gate-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.gate-badge {
  background: #F3F4F6;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Full Report & Canvas View */
.unlocked-report {
  display: none;
  animation: fadeIn 0.4s ease;
}

.canvas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (min-width: 640px) {
  .canvas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.canvas-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.canvas-box.full-width {
  grid-column: 1 / -1;
  background: #FDFBF7;
  border-color: #D97706;
}

.canvas-num {
  display: inline-flex;
  width: 26px;
  height: 26px;
  background: #15803D;
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.canvas-box.full-width .canvas-num {
  background: #D97706;
}

.canvas-box-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1C1917;
  margin-bottom: 8px;
}

.canvas-box-content {
  font-size: 14px;
  color: #44403C;
  line-height: 1.5;
}

.offer-statement {
  font-size: 17px;
  font-weight: 700;
  color: #92400E;
  background: #FEF3C7;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border-left: 4px solid #D97706;
  margin-top: 8px;
}

/* 12 Criteria Table/List */
.criteria-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.criteria-score {
  min-width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #1F2937;
}

.criteria-score.score-5 { background: #DCFCE7; color: #166534; }
.criteria-score.score-4 { background: #E0E7FF; color: #3730A3; }
.criteria-score.score-3 { background: #FEF3C7; color: #92400E; }
.criteria-score.score-1, .criteria-score.score-2 { background: #FEE2E2; color: #991B1B; }

.criteria-info {
  flex: 1;
}

.criteria-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
}

.criteria-question {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 2px 0 4px;
}

.criteria-feedback {
  font-size: 13.5px;
  color: #374151;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.btn-secondary {
  flex: 1;
  padding: 12px 18px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 40px 0 30px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--color-text-light);
}

.footer a {
  color: #15803D;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ==========================================
   QUOTA BADGE & COOLDOWN BOX
   ========================================== */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.cooldown-box {
  background-color: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  color: #1E40AF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.cooldown-icon {
  font-size: 18px;
  animation: pulse-dot 1.5s infinite;
}

/* ==========================================
   POPUP MODAL (ĐÁNH GIÁ 5 SAO NHẬN +2 LƯỢT)
   ========================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 9, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  max-width: 520px;
  width: 100%;
  padding: 32px 28px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #F5F3EF;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: #78716C;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #E7E2D9;
  color: #1C1917;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  color: #166534;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #0C0A09;
  line-height: 1.3;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Star Rating Selector */
.star-rating-box {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 20px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #D1D5DB;
  transition: transform 0.15s, color 0.15s;
  padding: 0 4px;
}

.star-btn.active, .star-btn:hover {
  color: #F59E0B;
  transform: scale(1.15);
}

.star-rating-label {
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #B45309;
  margin-bottom: 16px;
}

.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #A8A29E;
  font-size: 12px;
  font-weight: 600;
}

.modal-divider::before, .modal-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-divider span {
  padding: 0 10px;
}

.zalo-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0068FF;
  color: #FFFFFF;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
}

.zalo-cta-btn:hover {
  background: #0056D2;
  transform: translateY(-1px);
}
