/* ===== Reset & Variables — GIS Specialist brand ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* GIS Specialist palette */
  --bg: #e5e6e6;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #fafaf7;
  --border: #d8dbdc;
  --border-focus: #7a4de8;
  --text: #0d1a1d;
  --text-body: #003c46;
  --text-muted: #4a6670;
  --text-dim: #7d8a90;
  --accent: #7a4de8;            /* purple */
  --accent-hover: #5f35c7;
  --accent-soft: rgba(122, 77, 232, 0.10);
  --cta: #ffc857;               /* yellow CTA */
  --cta-hover: #ffba2e;
  --cta-text: #0d1a1d;
  --coral: #e05a50;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 37px;
  --font: 'Montserrat', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 760px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  font-weight: 400;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(229, 230, 230, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.logo-icon {
  font-size: 22px;
  color: var(--accent);
}
.logo-img {
  height: 40px;
  width: auto;
  display: block;
}
.header-cta {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 18px;
  background: var(--cta);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.header-cta:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
}

/* ===== Container ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Hero ===== */
.hero {
  padding: 60px 0 44px;
  text-align: center;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -0.8px;
  color: var(--text);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-body);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 400;
}
.hero-sub strong {
  color: var(--accent);
  font-weight: 700;
}

/* Manual download */
.manual-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: all 0.2s;
}
.manual-download:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== Generator ===== */
.generator { padding-bottom: 60px; }

/* Input Area */
.input-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(13, 26, 29, 0.04);
}
.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.prompt-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 14px 16px;
  resize: vertical;
  min-height: 84px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.prompt-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.prompt-textarea::placeholder { color: var(--text-dim); }
.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
}
.char-count { font-size: 12px; color: var(--text-dim); }

/* Generate Button */
.btn-generate {
  background: var(--cta);
  color: var(--cta-text);
  border: none;
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-generate:hover { background: var(--cta-hover); transform: translateY(-1px); }
.btn-generate:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(13, 26, 29, 0.25);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Examples */
.examples { margin-bottom: 32px; }
.examples-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.example-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.example-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Result Area ===== */
.result-area { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.result-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.result-meta { display: flex; gap: 8px; flex-shrink: 0; }
.meta-badge {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.meta-badge.difficulty { background: var(--accent-soft); color: var(--accent); }
.meta-badge.lines { background: rgba(255, 200, 87, 0.25); color: #8a6400; }

/* Code Container */
.code-container {
  position: relative;
  background: #1e1e2e;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-lang { font-size: 12px; color: rgba(255,255,255,0.5); font-family: var(--mono); }
.btn-copy {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.btn-copy:hover { background: rgba(255,255,255,0.18); color: #fff; }
.code-container pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}
.code-container code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

/* Blur overlay */
.code-blur {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  background: linear-gradient(transparent, #1e1e2e 40%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}
.blur-message p {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

/* Email Gate */
.email-gate {
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-out;
}
.email-gate-inner {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(122, 77, 232, 0.10);
}
.email-gate-text {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 16px;
  font-weight: 500;
}
.email-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.email-input {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 14px;
}
.email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-unlock {
  background: var(--cta);
  color: var(--cta-text);
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-unlock:hover { background: var(--cta-hover); transform: translateY(-1px); }
.email-privacy {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Explanation */
.explanation {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-out;
}
.explanation h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.explanation-text {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Remaining */
.remaining-badge {
  text-align: center;
  margin-bottom: 20px;
}
.remaining-badge span {
  display: inline-block;
  font-size: 12px;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* CTA Box */
.cta-box { margin-bottom: 24px; }
.cta-inner {
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 200, 87, 0.18));
  border: 1px solid rgba(122, 77, 232, 0.25);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.cta-inner h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.cta-inner p {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.btn-course {
  display: inline-block;
  background: var(--cta);
  color: var(--cta-text);
  text-decoration: none;
  padding: 12px 30px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.btn-course:hover { background: var(--cta-hover); transform: translateY(-1px); }

/* Limit Message */
.limit-message { animation: fadeIn 0.3s ease-out; }
.limit-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.limit-inner h3 { font-size: 19px; margin-bottom: 10px; color: var(--accent); font-weight: 700; }
.limit-inner p { font-size: 14px; color: var(--text-body); margin-bottom: 16px; }
.limit-cta { margin-top: 22px; }
.limit-cta p { margin-bottom: 14px; }

/* Error */
.error-message {
  background: rgba(224, 90, 80, 0.10);
  border: 1px solid rgba(224, 90, 80, 0.30);
  border-radius: var(--radius);
  padding: 16px 20px;
  animation: fadeIn 0.3s ease-out;
}
.error-message p { font-size: 14px; color: var(--coral); font-weight: 500; }

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer p { font-size: 13px; color: var(--text-muted); }
.footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-note { margin-top: 6px; font-size: 11px; }

/* ===== Consent ===== */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-body);
  margin: 14px 0 8px;
  cursor: pointer;
  line-height: 1.5;
  text-align: left;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.consent-checkbox {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.privacy-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.privacy-link:hover {
  color: var(--accent-hover);
}

/* ===== Confirmation Pending ===== */
.confirm-pending { margin-bottom: 16px; animation: fadeIn 0.3s ease-out; }
.confirm-pending-inner {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(122, 77, 232, 0.10);
}
.confirm-icon {
  font-size: 44px;
  margin-bottom: 14px;
}
.confirm-pending-inner h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.confirm-pending-inner p {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 8px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.confirm-note {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-style: italic;
  margin-bottom: 18px !important;
}
.btn-resend {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-resend:hover {
  background: var(--accent);
  color: #fff;
}

/* ===== Confirmation Success ===== */
.confirm-success { margin-bottom: 20px; animation: fadeIn 0.3s ease-out; }
.confirm-success-inner {
  background: rgba(122, 77, 232, 0.08);
  border: 1px solid rgba(122, 77, 232, 0.30);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.confirm-success-inner h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}
.confirm-success-inner p {
  font-size: 14px;
  color: var(--text-body);
}

/* ===== Session Bar ===== */
.session-bar {
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-out;
}
.session-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  box-shadow: 0 1px 3px rgba(13, 26, 29, 0.04);
}
.session-status {
  font-size: 14px;
  flex-shrink: 0;
}
.session-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-remaining {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 12px;
  border-radius: 12px;
  white-space: nowrap;
  margin-left: auto;
  font-weight: 600;
}
.session-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.session-logout:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* Footer links */
.footer-links {
  margin-top: 8px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero { padding: 44px 0 28px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .email-form { flex-direction: column; }
  .result-header { flex-direction: column; }
  .examples-grid { gap: 6px; }
  .example-chip { font-size: 12px; padding: 6px 12px; }
  .session-inner { flex-wrap: wrap; }
  .header-inner { gap: 8px; }
  .header-cta { font-size: 12px; padding: 6px 14px; }
}
