html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Orange Gradient Theme */
:root {
  --bs-primary: #f97316;
  --bs-primary-rgb: 249, 115, 22;
  --bs-link-color: #f97316;
  --bs-link-hover-color: #c2410c;
  --bs-focus-ring-color: rgba(249, 115, 22, 0.25);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
}

/* Navbar gradient */
.navbar-orange {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%) !important;
}

/* Primary button gradient */
.btn-primary {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  border-color: #f97316;
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
  border-color: #ea580c;
  color: #fff;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: linear-gradient(135deg, #fdba74 0%, #fed7aa 100%);
  border-color: #fdba74;
  color: #fff;
}

/* Focus states */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(249, 115, 22, 0.4);
}

.form-control:focus {
  border-color: #fb923c;
}

.form-check-input:checked {
  background-color: #f97316;
  border-color: #f97316;
}

.form-check-input:focus {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.25);
}

/* Links */
a {
  color: #f97316;
  text-decoration: none;
}

a:hover {
  color: #c2410c;
  text-decoration: underline;
}

/* Alert success - green */
.alert-success {
  background-color: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Alert danger - red */
.alert-danger {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Alert warning - amber */
.alert-warning {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* Alert info - blue */
.alert-info {
  background-color: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* Alert primary override - orange */
.alert-primary {
  background-color: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}

/* Pagination / active items */
.page-item.active .page-link {
  background-color: #f97316;
  border-color: #f97316;
}

.page-link {
  color: #f97316;
}

.page-link:hover {
  color: #c2410c;
}

/* Dropdown active item */
.dropdown-item:active {
  background-color: #f97316;
}

/* Avatar dropdown — sidebar style */
.topbar .dropdown-menu {
  border-radius: 0;
  border: 1px solid #fed7aa;
  padding: 0;
  min-width: 180px;
}

.topbar .dropdown-menu .dropdown-item {
  padding: 0.65rem 1.25rem;
  color: #4b5563;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

.topbar .dropdown-menu .dropdown-item:hover {
  background-color: #fed7aa;
  color: #c2410c;
  border-left-color: #f97316;
  text-decoration: none;
}

.topbar .dropdown-menu .dropdown-divider {
  margin: 0;
  border-color: #fed7aa;
}

.topbar .dropdown-menu form {
  margin: 0;
}

/* Progress bar */
.progress-bar {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
}

/* Badge */
.bg-primary {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%) !important;
}

/* Input group append button */
.input-group .btn-outline-secondary:hover {
  background-color: #fff7ed;
  border-color: #fb923c;
  color: #c2410c;
}

/* Custom orange button */
.btn-orange {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  border-color: #f97316;
  color: #fff;
}

.btn-orange:hover,
.btn-orange:focus,
.btn-orange:active {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
  border-color: #ea580c;
  color: #fff;
}

/* Outline orange button */
.btn-outline-orange {
  color: #f97316;
  border-color: #f97316;
  background-color: transparent;
}

.btn-outline-orange:hover,
.btn-outline-orange:focus,
.btn-outline-orange:active,
.btn-outline-orange.active {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  border-color: #f97316;
  color: #fff;
}

.btn-outline-secondary.active {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Orange background */
.bg-orange {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%) !important;
}

/* Orange border */
.border-orange {
  border: 2px solid #f97316 !important;
}

/* Card header */
.card-header.bg-primary {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%) !important;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Sidebar Layout ===== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border-right: 1px solid #fed7aa;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-logo {
  height: 32px;
  width: auto;
  border-radius: 4px;
}

.sidebar-brand:hover {
  color: #fff;
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: #4b5563;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  background-color: #fed7aa;
  color: #c2410c;
  border-left: 3px solid #f97316;
  padding-left: calc(1.25rem - 3px);
  text-decoration: none;
}

.sidebar-nav .nav-link.active {
  background-color: #fff7ed;
  color: #ea580c;
  border-left: 3px solid #f97316;
  padding-left: calc(1.25rem - 3px);
  text-decoration: none;
}

.sidebar-nav .nav-link svg {
  flex-shrink: 0;
}

.sidebar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.sidebar-divider {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  gap: 0.5rem;
}

.sidebar-divider::before,
.sidebar-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #fed7aa;
}

.sidebar-divider-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #fed7aa;
  background: #fff;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content.no-sidebar {
  margin-left: 0;
}

/* Home page: force collapsed sidebar on all screen sizes */
.sidebar.home-collapsed {
  transform: translateX(-100%);
}

.sidebar.home-collapsed.show {
  transform: translateX(0);
}

.main-content.home-collapsed {
  margin-left: 0;
}

.beta-badge {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.beta-banner {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #ffe0b2;
}

body > .beta-badge {
  border-radius: 0;
}

.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 29px;
  z-index: 1030;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  overflow: hidden;
}

.avatar-circle .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fed7aa;
}

.auth-logo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.75rem;
}

.avatar-circle::after {
  display: none;
}

.page-content {
  flex: 1;
  padding: 1.25rem;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1035;
  display: none;
}

.sidebar-backdrop.show {
  display: block;
}

/* Mobile / Tablet (< 992px) */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

/* Readonly / disabled form inputs */
.form-control:read-only,
.form-control[readonly] {
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

.form-control:read-only:focus,
.form-control[readonly]:focus {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: none;
}

/* Footer inside main-content */
.app-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #fed7aa;
  color: #9ca3af;
  font-size: 0.85rem;
  text-align: center;
}

/* ===== Page Loader ===== */
.page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: clamp(72px, 18vmin, 140px);
  height: clamp(72px, 18vmin, 140px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-rainbow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f472b6, #f87171);
  animation: loader-spin 1.2s linear infinite;
}

.loader-rainbow::before {
  content: '';
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 30%;
  background: #fff;
  border-radius: 45% 55% 65% 35% / 45% 45% 55% 55%;
  z-index: 2;
}

.loader-rainbow::after {
  content: '';
  position: absolute;
  inset: 7%;
  background: #fff;
  border-radius: 50%;
  z-index: 1;
}

.loader-logo {
  position: relative;
  width: clamp(52px, 13vmin, 100px);
  height: clamp(52px, 13vmin, 100px);
  border-radius: 50%;
  object-fit: cover;
  z-index: 3;
}

.loader-text {
  margin-top: 1.5rem;
  color: #c2410c;
  font-weight: 500;
  font-size: clamp(0.8rem, 2.5vmin, 1.1rem);
  text-align: center;
}

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

.text-orange {
  color: #f97316 !important;
}

/* ===== Homepage Sections ===== */
.hero-section {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #fff7ed 100%);
  border-bottom: 1px solid #fed7aa;
  padding: 3rem 1.25rem;
  text-align: center;
}

.hero-logo {
  width: clamp(80px, 15vw, 140px);
  height: clamp(80px, 15vw, 140px);
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #c2410c;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #78716c;
  margin-bottom: 1.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.home-section {
  padding: 3.5rem 0;
}

.home-section.bg-white {
  background: #fff;
}

.home-section.bg-light {
  background: #fff7ed;
}

.section-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #1c1917;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: #78716c;
  max-width: 560px;
  margin: 0 auto;
}

/* Trust Cards */
.trust-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.trust-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.1);
}

.trust-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.trust-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 0.5rem;
}

/* Service Cards */
.service-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.1);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.service-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 0.5rem;
}

/* Plan Cards */
.plan-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.1);
}

.plan-header {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  color: #fff;
  padding: 1rem 1.25rem;
}

.plan-name {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.plan-branch {
  font-size: 0.75rem;
  opacity: 0.9;
}

.plan-body {
  padding: 1.25rem;
}

.plan-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #c2410c;
  margin-bottom: 0.75rem;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: #44403c;
  font-size: 0.9rem;
  border-bottom: 1px solid #fff7ed;
}

.plan-features li svg {
  color: #22c55e;
  flex-shrink: 0;
}

/* Compact plan card variant */
.plan-card-sm .plan-header {
  padding: 0.625rem 0.875rem;
}

.plan-card-sm .plan-name {
  font-size: 0.9rem;
}

.plan-card-sm .plan-branch {
  font-size: 0.7rem;
}

.plan-card-sm .plan-body {
  padding: 0.75rem 0.875rem;
}

.plan-card-sm .plan-price {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.plan-card-sm .plan-features li {
  font-size: 0.78rem;
  padding: 0.2rem 0;
}

/* Age Badges */
.age-badge {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: transform 0.15s;
}

.age-badge:hover {
  transform: translateY(-2px);
}

.age-name {
  display: block;
  font-weight: 600;
  color: #c2410c;
  font-size: 0.9rem;
}

.age-range {
  display: block;
  font-size: 0.75rem;
  color: #78716c;
}

/* Step Cards */
.step-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.1);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 0.5rem;
}

.step-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Branch Cards */
.branch-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 1.25rem;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.1);
}

.branch-card h5 {
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 0.25rem;
}

.branch-carousel {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #fed7aa;
}

.branch-carousel-img {
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

.branch-no-photo {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.branch-no-photo img {
  height: 200px;
  object-fit: contain;
  padding: 1rem;
}

/* ===== Stats Counter Section ===== */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.stat-item {
  flex: 1 1 200px;
  max-width: 280px;
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(249, 115, 22, 0.12);
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  animation: stat-pop 0.6s ease-out;
}

.stat-number {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@keyframes stat-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }