/* ============================================================
   ESG Report Generator — page-specific styles
   Reuses design tokens from style.css
   ============================================================ */

/* ---- Hero ---- */
.er-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.er-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.er-hero__badge svg { color: var(--accent); }

.er-hero__title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.er-hero__sub {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-mid);
  max-width: 56ch;
  margin-bottom: 32px;
}

.er-hero__actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.er-hero__note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-light);
}

/* ---- App section ---- */
.er-app { padding: 0 0 96px; }

/* ---- Tabs ---- */
.er-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.er-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.er-tab:hover { color: var(--text); }
.er-tab--active { color: var(--accent); border-bottom-color: var(--accent); }
.er-tab svg { flex-shrink: 0; }

/* ---- Panels ---- */
.er-panel { display: none; }
.er-panel--active { display: block; }

.er-panel__header { margin-bottom: 32px; }

.er-panel__title {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.er-panel__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-mid);
  max-width: 60ch;
}

.er-panel__desc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   GENERATE REPORT PANEL — Form
   ============================================================ */

/* Section headings */
.er-section {
  margin-bottom: 32px;
}

.er-section__heading {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Form grid */
.er-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Field styles */
.er-field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.er-field__req {
  color: #ef4444;
}

.er-field__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color 0.15s;
}

.er-field__input:focus { outline: none; border-color: var(--accent); }
.er-field__input::placeholder { color: var(--text-light); }

.er-field__select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.er-field__select:focus { outline: none; border-color: var(--accent); }

.er-field--full {
  grid-column: 1 / -1;
}

/* Checkbox group */
.er-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.er-checkbox-group--actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}

.er-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-mid);
}

.er-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Progress indicator */
.er-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
}

.er-progress[hidden] { display: none; }

.er-progress__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: er-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.er-progress__text {
  font-size: 14px;
  color: var(--text-mid);
}

/* Results / Ready section */
.er-ready {
  margin-top: 32px;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
  text-align: center;
}

.er-ready__icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.er-ready__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.er-ready__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-mid);
  margin-bottom: 24px;
}

.er-ready__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ============================================================
   SAMPLE REPORT PANEL
   ============================================================ */
.er-samples {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.er-sample {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.er-sample:last-child { border-bottom: none; }

.er-sample__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.er-sample__body h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.er-sample__body p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-mid);
}

/* ============================================================
   ABOUT ESG PANEL
   ============================================================ */
.er-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.er-fact {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
}

.er-fact__number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 12px;
}

.er-fact__body h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.er-fact__body p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-mid);
}

/* Why SMEs need ESG */
.er-why {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
}

.er-why h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.er-why ul {
  list-style: disc;
  padding-left: 20px;
}

.er-why li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.er-why li:last-child { margin-bottom: 0; }

.er-why strong {
  color: var(--text);
  font-weight: 600;
}

/* Related tools */
.er-tools {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
}

.er-tools h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.er-tools ul {
  list-style: disc;
  padding-left: 20px;
}

.er-tools li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.er-tools li:last-child { margin-bottom: 0; }

.er-tools a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Info box */
.er-infobox {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 14px;
  line-height: 1.6;
}

.er-infobox svg { flex-shrink: 0; margin-top: 2px; }
.er-infobox strong { font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 840px) {
  .er-facts { grid-template-columns: 1fr; }
  .er-form__grid { grid-template-columns: 1fr; }
  .er-checkbox-group--actions { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .er-hero { padding: 40px 0 32px; }
  .er-hero__actions { flex-direction: column; align-items: flex-start; gap: 12px; }
  .er-tab { padding: 12px 16px; font-size: 13px; }
  .er-tab svg { display: none; }
  .er-ready { padding: 24px; }
  .er-ready__actions { flex-direction: column; }
}
