/* =====================================================
   Public UI Theme (scoped to .public-ui)
   Bootstrap-first, minimal custom CSS
   ===================================================== */

/* Tokens (scoped to public UI). Brand comes from theme.css */
.public-ui {
  --ink: #0b1220;            /* near-black text */
  --muted: #5b6472;

  /* Soft surfaces */
  --surface: #ffffff;
  --surface-2: #f6f8fb;

  /* Shadows + radius */
  --radius: 1.25rem;
  --shadow-sm: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 16px 44px rgba(16, 24, 40, 0.12);

  /* Keep Bootstrap primary scoped (brand defined globally in theme.css) */
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
}

/* Base type (public only) */
body.public-ui {
  font-size: 1rem;
  color: var(--ink);
}

.public-ui .text-muted {
  color: var(--muted) !important;
}

/* Make links match the public brand (avoid Bootstrap blue) */
.public-ui a {
  color: var(--bs-primary);
}

.public-ui a:hover {
  color: var(--brand-hover);
}

/* Ensure any .text-primary follows brand (avoid Bootstrap blue) */
.public-ui .text-primary {
  color: var(--bs-primary) !important;
}

/* Public: avoid green "success" accents; align to brand */
.public-ui .text-success {
  color: var(--brand) !important;
}

/* =====================================================
   Navbar polish
   ===================================================== */

.public-ui .navbar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.public-ui .navbar .navbar-brand {
  background: transparent !important;
  box-shadow: none !important;
}

.public-ui .navbar .nav-link {
  font-weight: 500;
}


/* =====================================================
   Buttons: make "primary" = green everywhere on public UI
   ===================================================== */

.public-ui .btn {
  border-radius: 999px;
  padding: 0.65rem 1rem;
}

.public-ui .btn-lg {
  padding: 0.85rem 1.25rem;
}

/* ---------- Solid primary (green) ---------- */
.public-ui .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-active);
  --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-active-color: #fff;

  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 26px rgba(var(--brand-rgb), 0.22);
}

/* ---------- Outline primary ---------- */
.public-ui .btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--bs-primary);

  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;

  --bs-btn-active-bg: var(--brand-active);
  --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-active-color: #fff;

  --bs-btn-disabled-color: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

/* Lift on hover */
.public-ui .btn-primary:hover,
.public-ui .btn-outline-primary:hover {
  transform: translateY(-1px);
}

/* Links that use primary */
.public-ui .link-primary {
  color: var(--bs-primary) !important;
}

/* Ensure readable text on primary buttons (public pages) */
.public-ui .btn-primary,
.public-ui .btn-primary:focus,
.public-ui .btn-primary:hover,
.public-ui .btn-primary:active {
  color: #fff;
}

/* Outline primary buttons – keep text readable on hover */
.public-ui .btn-outline-primary:hover,
.public-ui .btn-outline-primary:active {
  color: #fff;
}

.public-ui .badge.bg-primary {
  color: #fff;
}


/* =====================================================
   Cards: premium look
   ===================================================== */

.public-ui .card {
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
}

.public-ui .card:hover {
  box-shadow: var(--shadow-md);
}

.public-ui .how-to-apply .card.text-white .btn-light {
  color: var(--brand);
  font-weight: 600;
}

.public-ui .card.text-white[style*="linear-gradient"] {
  background: linear-gradient(
    180deg,
    rgba(var(--brand-rgb), 0.95),
    rgba(var(--brand-rgb), 0.85)
  ) !important;
  border: 0;
}

/* Make the callout button text align with brand */
.public-ui .card.text-white[style*="linear-gradient"] .btn-light {
  color: var(--brand);
  font-weight: 600;
}


/* =====================================================
   Small “icon tile” helpers
   ===================================================== */

.public-ui .icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--brand-rgb), 0.10);
  color: var(--brand);
}


/* =====================================================
   Trust chips
   ===================================================== */

.public-ui .badge.text-bg-light.border {
  border-color: rgba(16, 24, 40, 0.10) !important;
  background: rgba(255, 255, 255, 0.92) !important;
}


/* =====================================================
   Hero surface (soft gradient + subtle grid mask)
   ===================================================== */

.public-ui .hero-surface {
  position: relative;
  background:
    radial-gradient(900px circle at 10% 10%, rgba(var(--brand-rgb), 0.14), transparent 45%),
    radial-gradient(900px circle at 90% 20%, rgba(var(--brand-rgb), 0.10), transparent 50%),
    linear-gradient(#fff, #fff);
  overflow: hidden;
}

.public-ui .hero-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 24, 40, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(60% 55% at 50% 5%, black 0%, transparent 70%);
  pointer-events: none;
}

.public-ui .hero-surface > .container {
  position: relative;
  z-index: 1;
}


/* Hero crest tile */
.public-ui .hero-crest {
  width: 56px;
  height: 56px;

  display: inline-flex;
  align-items: center;
  justify-content: center;


  padding: 8px; /* breathing room so it doesn't touch edges */
  flex: 0 0 auto;
}

/* Crest image: never stretch */
.public-ui .hero-crest-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (min-width: 992px) {
  .public-ui .hero-crest {
    width: 100px;
    height: 100px;
  }
}


/* =====================================================
   Section rhythm
   ===================================================== */

.public-ui section {
  scroll-margin-top: 80px;
}


/* =====================================================
   Forms (public only, subtle)
   ===================================================== */

.public-ui .form-control:focus,
.public-ui .form-select:focus {
  border-color: rgba(var(--brand-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.18);
}


/* =====================================================
   Footer links (if needed)
   ===================================================== */

.public-ui footer a {
  text-decoration: none;
}

.public-ui footer a:hover {
  text-decoration: underline;
}


/* =====================================================
   Government header strip (Public only)
   ===================================================== */

.public-ui .gov-strip {
  background: linear-gradient(180deg, var(--brand-active), var(--brand));
  color: #fff;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.public-ui .gov-strip .gov-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.public-ui .gov-strip .gov-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.public-ui .gov-strip .gov-meta {
  opacity: 0.9;
  font-size: 0.8rem;
}

.public-ui .gov-strip .gov-meta i {
  margin-right: 0.25rem;
}



/* =====================================================
   Misc
   ===================================================== */

.public-ui .rounded-4 { border-radius: 1.25rem !important; }


.public-ui .accordion-item {
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: .75rem;
}

.public-ui .accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), 0.18);
}

/* ===========================
   Auth pages (Devise) – premium
   =========================== */

.public-ui .auth-card {
  border-radius: 1.5rem !important;
  box-shadow: 0 18px 55px rgba(16, 24, 40, 0.14);
}

.public-ui .auth-crest {
  width: 92px;
  height: 92px;
  border-radius: 1.5rem;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-rgb), 0.10);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  padding: 12px;
}

.public-ui .auth-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Make auth links look intentional */
.public-ui .auth-links a {
  color: var(--brand);
  font-weight: 600;
}

.public-ui .auth-links a:hover {
  color: var(--brand-hover);
  text-decoration: underline !important;
}

/* Slightly softer input background on public auth */
.public-ui .form-control.form-control-lg {
  border-radius: 1rem;
}


/* Auth logo link */
.public-ui .auth-crest {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.public-ui a.auth-crest:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(var(--brand-rgb), 0.25);
  text-decoration: none;
}
