:root {
  --bg: #0b1e33;
  --bg-raised: #0f2740;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.64);
  --text-faint: rgba(255, 255, 255, 0.42);
  --accent: #2fd1f5;
  --accent-text: #06222f;
  --error: #ff8a8a;

  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 48px;
}

.wrap {
  width: 100%;
  max-width: 560px;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 28px;
  text-align: center;
}

/* progress */

.progress-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 320ms ease;
}

/* screen card */

.screen {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.screen.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 96px 0;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--surface-border);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}

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

.loading-message {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  text-align: center;
}

.screen-title {
  font-size: 24px;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field-required {
  color: var(--accent);
  margin-left: 2px;
}

.field-helper {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 10px;
}

.field-optional-tag {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 6px;
}

.input-shell {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  transition: border-color 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--accent);
}

.input-affix {
  padding: 0 0 0 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 15px;
}

.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 14px;
}

.field input[type="text"] {
  font-family: var(--font-body);
}

.field input::placeholder {
  color: var(--text-faint);
}

.field-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 6px;
}

.duration-row {
  display: flex;
  gap: 12px;
}

.duration-input {
  flex: 1;
}

.duration-sublabel {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 6px;
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-option {
  text-align: left;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.choice-option:hover {
  border-color: rgba(47, 209, 245, 0.5);
}

.choice-option.selected {
  border-color: var(--accent);
  background: rgba(47, 209, 245, 0.1);
}

.field-consent {
  margin-bottom: 8px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-label a {
  color: var(--accent);
}

.banner-error {
  background: rgba(255, 138, 138, 0.1);
  border: 1px solid rgba(255, 138, 138, 0.35);
  color: var(--error);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* buttons */

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 120ms ease, opacity 160ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  flex: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
}

.btn-block {
  width: 100%;
}

/* report */

.report-heading {
  font-size: 26px;
  margin-bottom: 4px;
}

.report-subheading {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.report-section {
  margin-bottom: 28px;
}

.report-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 15px;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

.cost-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 20px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  padding: 6px 0;
}

.cost-line .stat-value {
  font-size: 16px;
}

.cost-total {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cost-total-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cost-total-value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
}

.working-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
  word-break: break-word;
}

.assumptions-line {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 16px;
  line-height: 1.6;
}

.opportunity-banner {
  background: rgba(47, 209, 245, 0.08);
  border: 1px solid rgba(47, 209, 245, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
}

.opportunity-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.opportunity-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.placeholder-block {
  border: 1px dashed var(--surface-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.placeholder-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.placeholder-tag {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(47, 209, 245, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 10px;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  margin: 0;
}

.placeholder-block.is-generated {
  border-style: solid;
}

.placeholder-block.is-generated .placeholder-text {
  color: var(--text);
  font-style: normal;
}

.secondary-opportunity-line {
  color: var(--text-faint);
  font-size: 12.5px;
  font-style: normal;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--surface-border);
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
}

.btn-whatsapp {
  background: #25d366;
  color: #06222f;
  text-align: center;
  text-decoration: none;
  display: block;
}

/* footer */

.app-footer {
  margin-top: 40px;
  text-align: center;
}

.app-footer a {
  color: var(--text-faint);
  font-size: 12.5px;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

.app-footer span {
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 0 8px;
}

/* legal pages (privacy.html, terms.html) */

.legal-back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 32px;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 28px;
}

.legal-intro {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.legal-contact {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--surface-border);
}

.legal-contact p {
  margin: 0 0 6px;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 10px;
}

.legal-section p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px;
  word-wrap: break-word;
}

.legal-section a {
  color: var(--accent);
}

.legal-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--surface-border);
}

/* discreet admin link (index.html only) */

.admin-link {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1;
  font-size: 11px;
  color: var(--text-faint);
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

/* admin submissions page */

.admin-wrap {
  max-width: 960px;
}

.admin-error {
  color: var(--error);
  font-size: 14px;
  margin: 12px 0 0;
}

.admin-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 32px 0;
  text-align: center;
}

.admin-count {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0 0 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
}

.admin-table th {
  color: var(--text-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  background: var(--surface);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table td.admin-num {
  font-family: var(--font-mono);
  text-align: right;
}

.admin-table td.admin-contacted-yes {
  color: var(--accent);
}

.admin-table td.admin-contacted-no {
  color: var(--text-faint);
}

@media (min-width: 640px) {
  .app {
    padding-top: 56px;
  }

  .nav-row {
    justify-content: flex-end;
  }

  .btn-primary {
    flex: none;
    min-width: 200px;
  }

  .report-actions {
    flex-direction: row;
  }

  .report-actions .btn,
  .report-actions .btn-whatsapp {
    flex: 1;
  }
}
