/* 1. Theme Variables */
:root {
  --primary: #1f6feb;
  --primary-hover: #1652b5;
  --accent: #24bca4;
  --accent-hover: #1a8c79;
  --bg-base: #f8fafc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --radius: 16px;
  --container-width: 1200px;
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 2. Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 3. Base Styles */
body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

/* Legacy responsive embeds */
.responsive-object {
  position: relative;
}

.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 4. Navbar */
.navbar {
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.navbar-main {
  background: linear-gradient(135deg, #111827, #0b1223 60%, #0f172a);
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.brand-block {
  flex: 1;
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f172a;
  padding: 3px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.brand-logo-sm {
  width: 40px;
  height: 40px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-domain {
  font-size: 0.86rem;
  color: #cbd5f5;
}

.navbar-main .navbar-brand {
  color: #fff;
  margin: 0;
}

.navbar-tag {
  color: #cbd5f5;
  font-size: 0.9rem;
}

.footer .brand-domain {
  color: var(--text-muted);
}

.navbar-main .btn-outline {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.navbar-main .btn-outline:hover {
  border-color: #fff;
  color: #fff;
}

.test-landing-header .section-title,
.test-landing-header .navbar-brand {
  color: #f9fafb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.test-landing-header .btn-outline {
  border-color: rgba(255, 255, 255, 0.75);
  color: #f9fafb;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
}

.test-landing-header .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* 5. Cards & Tiles */
.card,
.stat-tile,
.quote-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.stat-tile:hover,
.quote-block:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quote-block {
  border-left: 4px solid var(--primary);
  background: #f3f6ff;
}

.richtext-content > *:not(:last-child) {
  margin-bottom: 1rem;
}

.article-body img {
  width: 100%;
}

/* 6a. Forms */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.2);
}

.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.25rem;
}

.form-actions.align-start {
  justify-content: flex-start;
}

/* 7. Typography Helpers */
.text-muted {
  color: var(--text-muted) !important;
}

.section-title {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.display-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/* 8. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary), #4a8dff);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(120deg, var(--primary-hover), #3f7ae0);
}

.btn-outline {
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

/* 9. Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-soft-primary {
  background: rgba(31, 111, 235, 0.1);
  color: #1f6feb;
}

.badge-soft-success {
  background: rgba(36, 188, 164, 0.1);
  color: #158f7e;
}

/* 10. Tables */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f1f5f9;
  font-weight: 600;
}

td {
  color: var(--text-muted);
}

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

/* 11. Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: 1rem;
}

.alert-debug {
  background: #e5e7eb;
  border-color: var(--border);
  color: var(--text-main);
}

.alert-error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* 12. Footer */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  background: #f1f5f9;
  border-top: 1px solid var(--border);
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand .brand-name {
  font-weight: 700;
}

.footer-links span {
  color: var(--text-muted);
}

.footer-links a {
  font-weight: 600;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-item a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-item a:hover {
  color: var(--primary);
}

/* 13. Layout Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.section {
  margin-bottom: 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 640px;
}

.landing-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.feature-list {
  list-style: none;
  padding: 1.25rem;
  margin: 0;
}

.feature-list li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.feature-list a {
  font-weight: 600;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cta-row span {
  flex: 1;
  text-align: right;
}

.landing-hero .cta-row {
  justify-content: flex-start;
}

.expiring-row {
  background: rgba(255, 99, 71, 0.12);
}

/* 14. Test landing (dark theme overrides) */
body.test-landing-body {
  background: radial-gradient(circle at top, rgba(31, 111, 235, 0.18), transparent 45%),
              linear-gradient(135deg, #050915, #0f172a 50%, #1c1f2b);
  color: #fff;
}

body.test-landing-body .navbar,
body.test-landing-body .footer {
  display: none;
}

body.test-landing-body .card,
body.test-landing-body .form-panel,
body.test-landing-body .stat-tile,
body.test-landing-body .quote-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

body.test-landing-body .text-muted {
  color: #cbd5f5 !important;
}

.test-landing-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

.test-landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #fff;
}

.test-landing-card {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.test-landing-card .hero-block {
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--primary), #d6336c);
  text-align: left;
  color: #fff;
}

.test-landing-card .hero-block h1 {
  margin-bottom: 0.75rem;
  color: #fff;
}

.test-landing-card .hero-block p,
.test-landing-card .hero-block .badge {
  color: #f3f4f6;
}

.test-landing-card .body-block {
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

.test-landing-card .body-block .card,
.test-landing-card .body-block .form-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  box-shadow: 0 15px 35px rgba(5, 9, 21, 0.4);
}

.test-landing-card .body-block a {
  color: #8bbcff;
}

.test-landing-card .body-block a:hover {
  color: #b1d3ff;
}

@media (max-width: 600px) {
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row span {
    text-align: center;
  }
}

/* 15. Responsive adjustments */
@media (max-width: 992px) {
  .test-landing-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .test-landing-card .hero-block,
  .test-landing-card .body-block {
    padding: 1.75rem;
  }
}
