/**
 * Gryffi Finish Score — tool-specific styles.
 * Layered on top of the website's base styles and instant-preview.css.
 */

[hidden] { display: none !important; }

:root {
  --fs-primary: #0b4b34;
  --fs-primary-dark: #093d2a;
  --fs-accent: #78c503;
  --fs-bg: #ecf2eb;
  --fs-card: #ffffff;
  --fs-text: #1f2937;
  --fs-text-muted: #6b7280;
  --fs-border: #e5e7eb;
  --fs-radius: 18px;
  --fs-radius-sm: 10px;
  --fs-shadow: 0 8px 24px rgba(9, 61, 42, 0.08);
  --fs-shadow-strong: 0 14px 40px rgba(9, 61, 42, 0.14);

  --fs-color-terrible: #c1272d;
  --fs-color-heavy: #e87722;
  --fs-color-decent: #c7a008;
  --fs-color-good: #60a823;
  --fs-color-excellent: #3a8a3a;
}

.fs-main {
  padding: 140px 0 64px;
  min-height: calc(100vh - 120px);
  background: var(--fs-bg);
}

.fs-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.fs-state { display: block; }

/* ====== HERO / INPUT ====== */

.fs-hero {
  text-align: center;
  margin-bottom: 36px;
}

.fs-kicker {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(11, 75, 52, 0.08);
  color: var(--fs-primary-dark);
  margin-bottom: 16px;
}

.fs-heading {
  font-family: var(--ip-font-display, 'Outfit', system-ui, sans-serif);
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fs-primary-dark);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.fs-subheading {
  font-size: 17px;
  line-height: 1.55;
  color: var(--fs-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.fs-input-card {
  background: var(--fs-card);
  border-radius: var(--fs-radius);
  padding: 28px;
  box-shadow: var(--fs-shadow);
  margin-bottom: 28px;
}

.fs-form {
  position: relative;
}

/* ====== TABS ====== */

.fs-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #f1f5f2;
  border-radius: 12px;
  margin-bottom: 22px;
  width: fit-content;
  max-width: 100%;
}

.fs-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--fs-text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.fs-tab:hover:not(.fs-tab--active) {
  color: var(--fs-text);
}

.fs-tab:focus-visible {
  outline: 2px solid var(--fs-primary);
  outline-offset: 2px;
}

.fs-tab--active {
  background: #ffffff;
  color: var(--fs-primary-dark);
  box-shadow: 0 2px 6px rgba(9, 61, 42, 0.08);
}

.fs-tab-icon {
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.9;
}

.fs-tab-panel {
  animation: fs-fade-in 0.2s ease-out;
}

@keyframes fs-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== PDF DROPZONE ====== */

.fs-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  background: #fafcfa;
  border: 2px dashed #cfdad1;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.fs-dropzone:hover,
.fs-dropzone:focus-visible {
  outline: none;
  border-color: var(--fs-primary);
  background: #f1f7f2;
}

.fs-dropzone--drag {
  border-color: var(--fs-primary);
  background: #eaf3ec;
}

.fs-dropzone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fs-dropzone-icon {
  color: var(--fs-primary);
  margin-bottom: 4px;
}

.fs-dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--fs-text);
  margin: 0;
}

.fs-dropzone-or {
  font-size: 13px;
  color: var(--fs-text-muted);
  margin: 0;
}

.fs-btn--secondary {
  background: #ffffff;
  color: var(--fs-primary-dark);
  border: 1.5px solid var(--fs-border);
  padding: 10px 18px;
  font-size: 14px;
}

.fs-dropzone-browse {
  pointer-events: none;
}

.fs-dropzone-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--fs-text-muted);
}

.fs-dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 6px 44px 6px 6px;
  position: relative;
  color: var(--fs-primary-dark);
}

.fs-dropzone-selected svg {
  color: var(--fs-primary);
  flex: 0 0 auto;
}

.fs-dropzone-file {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fs-text);
  word-break: break-all;
  text-align: left;
}

.fs-dropzone-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--fs-text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(9, 61, 42, 0.12);
  transition: color 0.15s, transform 0.08s;
}

.fs-dropzone-remove:hover {
  color: #c1272d;
  transform: scale(1.05);
}

.fs-pdf-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.fs-pdf-actions .fs-btn {
  min-width: 180px;
}

.fs-input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fs-text);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.fs-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fs-input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--fs-text);
  background: #fff;
  border: 1.5px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fs-input:focus {
  outline: none;
  border-color: var(--fs-primary);
  box-shadow: 0 0 0 3px rgba(11, 75, 52, 0.14);
}

.fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--fs-radius-sm);
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.fs-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fs-btn--primary {
  background: var(--fs-primary);
  color: #fff;
}
.fs-btn--primary:hover:not(:disabled) {
  background: var(--fs-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(9, 61, 42, 0.2);
}

.fs-btn--large {
  padding: 16px 28px;
  font-size: 16px;
  border-radius: 12px;
}

.fs-btn--ghost {
  background: transparent;
  color: var(--fs-primary-dark);
  border: 1.5px solid var(--fs-border);
}
.fs-btn--ghost:hover {
  border-color: var(--fs-primary);
  color: var(--fs-primary-dark);
}

.fs-input-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fs-text-muted);
}

.fs-error {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fdecea;
  color: #8a1b14;
  border-radius: var(--fs-radius-sm);
  font-size: 14px;
  line-height: 1.4;
}

/* ====== CHECKPOINTS ====== */

.fs-checkpoints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fs-checkpoint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
}

.fs-checkpoint-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: grid;
  place-items: center;
  background: rgba(11, 75, 52, 0.08);
  color: var(--fs-primary-dark);
  border-radius: 10px;
}

.fs-checkpoint-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fs-text);
  margin: 0 0 4px;
}

.fs-checkpoint-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--fs-text-muted);
  margin: 0;
}

/* ====== LOADING STATE ====== */

.fs-loading-card {
  background: var(--fs-card);
  border-radius: var(--fs-radius);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--fs-shadow);
}

.fs-loading-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.fs-loading-svg {
  transform: rotate(-90deg);
}

.fs-loading-track {
  stroke: rgba(11, 75, 52, 0.12);
}

.fs-loading-arc {
  stroke: var(--fs-primary);
  stroke-dasharray: 45 150;
  transform-origin: center;
  animation: fs-spin 1.2s linear infinite;
}

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

.fs-loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--fs-primary-dark);
  margin: 0 0 16px;
  min-height: 1.5em;
  transition: opacity 0.25s ease;
}

.fs-text-fade { opacity: 0; }

.fs-progress-bar {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 12px;
  height: 6px;
  background: rgba(11, 75, 52, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.fs-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fs-primary), var(--fs-accent));
  border-radius: 999px;
  transition: width 0.18s ease-out;
}

.fs-loading-detail {
  font-size: 13px;
  color: var(--fs-text-muted);
  margin: 0;
}

/* ====== RESULT STATE ====== */

.fs-result-card {
  background: var(--fs-card);
  border-radius: var(--fs-radius);
  padding: 36px;
  box-shadow: var(--fs-shadow-strong);
}

.fs-score-block {
  display: flex;
  gap: 28px;
  align-items: center;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--fs-border);
}

.fs-score-circle {
  width: 140px;
  height: 140px;
  min-width: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--fs-color-heavy), #c86a1a);
  box-shadow: 0 10px 28px rgba(200, 106, 26, 0.28);
}

.fs-score-circle[data-category="terrible"] {
  background: linear-gradient(135deg, var(--fs-color-terrible), #8a1c22);
  box-shadow: 0 10px 28px rgba(193, 39, 45, 0.28);
}
.fs-score-circle[data-category="heavy"] {
  background: linear-gradient(135deg, var(--fs-color-heavy), #c86a1a);
  box-shadow: 0 10px 28px rgba(232, 119, 34, 0.28);
}
.fs-score-circle[data-category="decent"] {
  background: linear-gradient(135deg, var(--fs-color-decent), #a68506);
  box-shadow: 0 10px 28px rgba(199, 160, 8, 0.28);
}
.fs-score-circle[data-category="good"] {
  background: linear-gradient(135deg, var(--fs-color-good), #3d8a14);
  box-shadow: 0 10px 28px rgba(96, 168, 35, 0.28);
}
.fs-score-circle[data-category="excellent"] {
  background: linear-gradient(135deg, var(--fs-color-excellent), #246624);
  box-shadow: 0 10px 28px rgba(58, 138, 58, 0.28);
}

.fs-score-number {
  font-family: var(--ip-font-display, 'Outfit', system-ui, sans-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.fs-score-suffix {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
  font-weight: 500;
}

.fs-score-meta { flex: 1; min-width: 0; }

.fs-score-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--fs-primary-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}

.fs-score-completion {
  font-size: 15px;
  color: var(--fs-text);
  margin: 0 0 6px;
}

.fs-score-completion strong {
  font-weight: 700;
  color: var(--fs-primary-dark);
}

.fs-score-url {
  font-size: 13px;
  color: var(--fs-text-muted);
  margin: 0;
  word-break: break-all;
}

/* ====== PAIN POINTS ====== */

.fs-section-title {
  font-family: var(--ip-font-display, 'Outfit', system-ui, sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--fs-primary-dark);
  margin: 0 0 16px;
}

.fs-painpoints {
  margin-bottom: 28px;
}

.fs-painpoint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: fs-painpoint-counter;
}

.fs-painpoint {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px 22px 20px 20px;
  background: #ffffff;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fs-painpoint::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--fs-primary-dark);
  opacity: 0.75;
}

.fs-painpoint-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fs-primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  font-family: var(--ip-font-display, 'Outfit', system-ui, sans-serif);
  margin-top: 2px;
}

.fs-painpoint-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fs-text);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

@media (max-width: 560px) {
  .fs-painpoint {
    grid-template-columns: 32px 1fr;
    gap: 14px;
    padding: 16px 16px 16px 18px;
  }

  .fs-painpoint-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
  }

  .fs-painpoint-text {
    font-size: 15px;
  }
}

/* ====== BREAKDOWN ====== */

.fs-breakdown {
  margin-bottom: 28px;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
  background: #f9fafb;
}

.fs-breakdown-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  margin: 0;
  list-style: none;
}
.fs-breakdown-summary::-webkit-details-marker { display: none; }

.fs-breakdown-summary svg {
  transition: transform 0.2s;
}
.fs-breakdown[open] .fs-breakdown-summary svg {
  transform: rotate(180deg);
}

.fs-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 4px 18px 18px;
  display: grid;
  gap: 14px;
}

.fs-metric { display: block; }

.fs-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.fs-metric-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fs-text);
}

.fs-metric-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--fs-primary-dark);
  font-variant-numeric: tabular-nums;
}

.fs-metric-bar {
  height: 6px;
  background: rgba(11, 75, 52, 0.09);
  border-radius: 999px;
  overflow: hidden;
}

.fs-metric-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fs-primary), var(--fs-accent));
  border-radius: 999px;
  transition: width 0.6s ease-out;
}

/* ====== CTA BLOCK ====== */

.fs-cta-block {
  position: relative;
  margin-top: 36px;
  padding: 32px 28px 28px;
  background: linear-gradient(180deg, #f3f9f3 0%, #e9f2ea 100%);
  border: 1px solid #d6e6d8;
  border-radius: 16px;
  text-align: center;
}

.fs-cta-block::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  background: var(--fs-primary);
  border-radius: 0 0 3px 3px;
}

.fs-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fs-primary-dark);
  background: rgba(11, 75, 52, 0.10);
  border-radius: 999px;
  margin-bottom: 14px;
}

.fs-cta-badge svg {
  color: var(--fs-primary);
}

.fs-cta-heading {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--fs-primary-dark);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.fs-cta-sub {
  margin: 0 auto 20px;
  max-width: 560px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--fs-text);
}

.fs-cta-bullets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}

.fs-cta-bullet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fs-primary-dark);
}

.fs-cta-bullet svg {
  color: var(--fs-accent);
  flex: 0 0 auto;
}

/* ====== RESULT ACTIONS ====== */

.fs-result-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.fs-result-actions .fs-btn { flex: 0 1 auto; min-width: 200px; }

.fs-cta-block .fs-btn--primary {
  box-shadow: 0 8px 22px rgba(9, 61, 42, 0.22);
}

.fs-cta-block .fs-btn--ghost {
  background: #ffffff;
}

.fs-convert-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--fs-text-muted);
  text-align: center;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== RESPONSIVE ====== */

@media (max-width: 640px) {
  .fs-main { padding: 120px 0 40px; }
  .fs-result-card { padding: 24px 18px; }
  .fs-score-block {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }
  .fs-score-circle { width: 120px; height: 120px; min-width: 120px; }
  .fs-score-number { font-size: 38px; }
  .fs-input-row { flex-direction: column; }
  .fs-btn { width: 100%; }
  .fs-input { width: 100%; }
  .fs-tabs { width: 100%; }
  .fs-tab { flex: 1 1 0; justify-content: center; padding: 10px 12px; }
  .fs-pdf-actions { justify-content: stretch; }
  .fs-pdf-actions .fs-btn { width: 100%; min-width: 0; }
  .fs-dropzone { min-height: 160px; padding: 18px; }
  .fs-cta-block { padding: 26px 18px 22px; margin-top: 28px; }
  .fs-cta-heading { font-size: 21px; }
  .fs-cta-sub { font-size: 15px; }
  .fs-cta-bullets { gap: 8px 14px; }
  .fs-result-actions .fs-btn { width: 100%; min-width: 0; }
}
