:root {
  --primary: #1f3a5f;
  --primary-dark: #142840;
  --secondary: #4a90e2;
  --accent: #2fb8a0;
  --accent-soft: #50e3c2;
  --danger: #c0392b;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #dbe4f0;
  --shadow: 0 10px 30px rgba(20, 40, 64, 0.08);
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(80, 227, 194, 0.16), transparent 50%),
    linear-gradient(180deg, #eef3f9 0%, var(--bg) 40%);
}

.app-header {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary) 55%, #20466e);
  border-bottom: 3px solid var(--accent-soft);
}

.app-header .navbar {
  padding: 0.85rem 0;
}

.app-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--accent);
  color: var(--primary-dark);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.app-header .nav-link {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 600;
  padding: 0.45rem 0.8rem !important;
}

.app-header .nav-link:hover {
  color: var(--accent-soft) !important;
}

.app-header .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

.app-header .navbar-toggler-icon {
  filter: invert(1);
}

.app-main {
  flex: 1;
  padding: 2.4rem 0 4rem;
}

.app-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 1rem 0;
  font-size: 0.9rem;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.hero, .page-head {
  margin-bottom: 1.8rem;
}

.hero h1, .page-head h1 {
  color: var(--primary-dark);
  font-weight: 700;
  max-width: 18ch;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions, .form-actions, .result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

.form-actions.compact {
  margin-top: 0.4rem;
}

.btn {
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-weight: 700;
  border: 0;
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-accent:hover, .btn-accent:disabled {
  background: var(--accent-soft);
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.5rem;
  margin-bottom: 1.1rem;
}

.panel header {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.panel h2, .page-head h1 {
  margin-bottom: 0.35rem;
}

.panel header p, .panel p, .hint {
  color: var(--muted);
  margin: 0;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 34px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem 1rem;
}

.field label {
  font-weight: 650;
  margin-bottom: 0.35rem;
  color: var(--primary);
}

.id-preview {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f0f7f5;
  border: 1px dashed var(--accent);
}

.id-preview span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.id-preview code, .facts code, .xml-view {
  color: var(--primary-dark);
}

.check-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 1rem;
  font-weight: 600;
}

.result-banner {
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}

.result-banner.success {
  background: #e8f8f3;
  border: 1px solid #9ee0d0;
}

.result-banner.error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
}

.step-list {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.step-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.step-status.ok {
  background: #d1f5ea;
  color: #0f766e;
}

.step-status.fail {
  background: #fde2e0;
  color: var(--danger);
}

.facts {
  display: grid;
  gap: 0.55rem;
}

.facts div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.6rem;
}

.facts dt {
  color: var(--muted);
  font-weight: 600;
}

.xml-view {
  background: #0f1c2e;
  color: #d6e8ff;
  padding: 1rem;
  border-radius: 12px;
  overflow: auto;
  max-height: 360px;
  font-size: 0.82rem;
}

.hint.warn {
  color: #b45309;
  margin: 0.8rem 0;
}

.validation-summary ul {
  margin-bottom: 0;
}

@media (max-width: 576px) {
  .hero h1, .page-head h1 {
    max-width: none;
  }

  .facts div {
    grid-template-columns: 1fr;
  }
}
