@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  --agf-bg: #f8fafc;
  --agf-ink: #0f172a;
  --agf-muted: #64748b;
  --agf-line: #e2e8f0;
  --agf-card: #ffffff;
  --agf-emerald: #10b981;
  --agf-emerald-dark: #064e3b;
}

body {
  font-family: "Inter", sans-serif;
}

.bg-grid-pattern {
  background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
  background-size: 30px 30px;
}

.topo-line {
  fill: none;
  stroke: rgba(16, 185, 129, 0.1);
  stroke-width: 1.5;
  animation: drift 30s linear infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-30px); }
}

.glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-text {
  background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.agf-page-bg {
  background: linear-gradient(180deg, #f8fafc 0%, #f2f7f5 100%);
  color: var(--agf-ink);
}

.agf-shell {
  min-height: 100vh;
}

.agf-shell-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(10px);
}

.agf-shell-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.agf-shell-nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.agf-shell-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.agf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  text-decoration: none;
}

.agf-brand-icon,
.agf-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.agf-brand-icon {
  display: inline-block;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18);
}

.agf-brand-wordmark {
  display: block;
  width: auto;
  height: 26px;
  max-width: 156px;
  object-fit: contain;
}

.agf-brand-mark {
  background: linear-gradient(135deg, #065f46, #10b981);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.2);
}

.agf-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.agf-link-btn,
.agf-btn {
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: 160ms ease;
}

.agf-link-btn {
  color: #334155;
  padding: 8px 12px;
}

.agf-link-btn:hover {
  color: #059669;
  background: rgba(16, 185, 129, 0.07);
}

.agf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  padding: 12px 16px;
}

.agf-btn-primary {
  background: #0f172a;
  color: #fff;
}

.agf-btn-primary:hover {
  background: #065f46;
}

.agf-btn-secondary {
  background: #10b981;
  color: #fff;
}

.agf-btn-secondary:hover {
  background: #059669;
}

.agf-btn-outline {
  background: #fff;
  border: 1px solid var(--agf-line);
  color: #0f172a;
}

.agf-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.agf-page-brand-lockup {
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
}

.agf-page-brand-lockup img {
  display: block;
  width: min(180px, 48vw);
  height: auto;
}

.agf-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--agf-line);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
  padding: 20px;
  margin: 0 0 18px;
}

.agf-muted { color: var(--agf-muted); }

.agf-secure-step {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.agf-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agf-trust-strip > div {
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  border-radius: 12px;
  padding: 12px;
}

.agf-trust-strip strong,
.agf-trust-strip span {
  display: block;
}

.agf-trust-strip strong {
  color: #064e3b;
  font-size: 13px;
  margin-bottom: 3px;
}

.agf-trust-strip span {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.agf-alert {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 12px;
}

.agf-page-head {
  max-width: 860px;
  margin: 0 auto 18px;
}

.agf-report-list {
  display: grid;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

.agf-report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--agf-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--agf-shadow);
}

.agf-report-actions {
  display: flex;
  justify-content: flex-end;
}

.agf-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.agf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.agf-field input,
.agf-field select,
.agf-field textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.agf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agf-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
}

.agf-pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
}

.agf-footer {
  border-top: 1px solid var(--agf-line);
  background: rgba(255, 255, 255, 0.9);
}

.agf-footer-top,
.agf-footer-bottom {
  max-width: 1120px;
  margin: 0 auto;
  color: var(--agf-muted);
  font-size: 12px;
}

.agf-footer-top {
  padding: 18px 16px 6px;
}

.agf-footer-bottom {
  display: block;
  padding: 6px 16px 18px;
  clear: both;
}

.agf-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.agf-footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.agf-footer-contact {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.agf-footer-contact a {
  color: #047857 !important;
  font-weight: 600;
}

.agf-footer-copyright {
  display: block;
  margin: 0;
  color: var(--agf-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  width: 100%;
}

.agf-footer-links a,
.agf-footer-contact a,
.agf-footer-link-button,
.agf-inline-link {
  color: #047857;
  text-decoration: none;
  font-weight: 600;
}

.agf-footer-links a:hover,
.agf-footer-contact a:hover,
.agf-footer-link-button:hover,
.agf-inline-link:hover {
  text-decoration: underline;
}

.agf-footer-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.agf-legal-page {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.agf-legal-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #334155;
  line-height: 1.65;
}

.agf-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 12px;
  padding: 14px;
}

.agf-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.agf-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.agf-cookie-banner[hidden],
.agf-cookie-modal[hidden] {
  display: none;
}

.agf-cookie-banner p {
  margin: 4px 0 6px;
  color: var(--agf-muted);
  line-height: 1.45;
}

.agf-cookie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.agf-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.agf-cookie-modal-card {
  max-width: 560px;
  width: 100%;
  border-radius: 16px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.agf-cookie-modal-card h2 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 1.35rem;
}

.agf-consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #064e3b;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  line-height: 1.45;
  font-weight: 600;
}

.agf-consent-box.compact {
  max-width: 720px;
}

.agf-consent-box input {
  margin-top: 3px;
}

.agf-inline-checkout-form {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.agf-checkout-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.agf-checkout-summary div {
  border: 1px solid var(--agf-line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.agf-checkout-summary strong,
.agf-checkout-summary span {
  display: block;
}

.agf-checkout-summary strong {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--agf-muted);
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .agf-form-grid { grid-template-columns: 1fr; }
  .agf-trust-strip { grid-template-columns: 1fr; }
  .agf-report-row { grid-template-columns: 1fr; }
  .agf-report-actions { justify-content: flex-start; }
  .agf-nav-links { gap: 8px; }
  .agf-cookie-banner { flex-direction: column; align-items: stretch; }
  .agf-cookie-actions { justify-content: flex-start; }
  .agf-checkout-summary { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .agf-footer-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .agf-footer-links {
    flex-wrap: wrap;
    white-space: normal;
  }
  .agf-footer-contact {
    justify-content: flex-start;
    margin-left: 0;
    text-align: left;
  }
}

/* Mapper UI (manual mapping fallback) */
.agf-mapper {
  display: block;
}

.agf-mapper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.agf-mapper-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.agf-mapper-header p { margin: 4px 0 0; }

.agf-raw-preview {
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.agf-raw-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.agf-raw-preview-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.agf-raw-scroll {
  overflow: auto;
  max-height: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.agf-raw-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.agf-raw-table th,
.agf-raw-table td {
  border: 1px solid #eef2f7;
  padding: 6px 8px;
  white-space: nowrap;
  text-align: left;
}

.agf-raw-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.agf-record-summary {
  border: 1px solid #dbe2ea;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.agf-map-section {
  border: 1px solid #dbe2ea;
  background: #fff;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}

.agf-map-section-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fbfdff;
  border-bottom: 1px solid #edf2f7;
}

.agf-map-section-summary::-webkit-details-marker {
  display: none;
}

.agf-map-section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
}

.agf-map-light {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.agf-map-light-green { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
.agf-map-light-amber { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
.agf-map-light-red { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }

.agf-map-table-wrap { overflow-x: auto; }

.agf-map-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.agf-map-table th,
.agf-map-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.agf-map-table th {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agf-map-target strong {
  display: block;
  font-weight: 700;
}

.agf-map-target span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

.agf-map-target code {
  font-size: 11px;
}

.agf-map-row-required_missing {
  background: #fffbeb;
}

.agf-map-row-auto {
  background: #f0fdf4;
}

.agf-map-row-user {
  background: #eff6ff;
}

.agf-map-row-ignored {
  background: #fff;
}

.agf-map-sample {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agf-map-sample-main {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 12px;
  color: #0f172a;
}

.agf-map-view-btn {
  background: none;
  border: 0;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
}

.agf-map-view-btn[disabled] {
  color: #94a3b8;
  text-decoration: none;
  cursor: default;
}

.agf-map-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.agf-map-badge-auto { background: #dcfce7; color: #166534; }
.agf-map-badge-user { background: #dbeafe; color: #1d4ed8; }
.agf-map-badge-required_missing { background: #fee2e2; color: #991b1b; }
.agf-map-badge-ignored { background: #e2e8f0; color: #475569; }

.agf-map-modal[hidden] {
  display: none;
}

.agf-map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.agf-map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.agf-map-modal-panel {
  position: relative;
  margin: 8vh auto 0;
  width: min(680px, calc(100vw - 24px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe2ea;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
  padding: 14px;
}

.agf-map-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.agf-map-modal-head h4 {
  margin: 0;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .agf-mapper-header {
    flex-direction: column;
    align-items: stretch;
  }
  .agf-map-section-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
