/* ============================================================
   DSD Group — Apply Portal  |  app.css   (mobile-first)
   ============================================================ */

:root {
  /* ── Brand colours ─────────────────────────────────────── */
  --clr-primary:        #0096b4;
  --clr-primary-dark:   #006d8f;
  --clr-accent:         #f5a623;

  /* ── Neutrals ───────────────────────────────────────────── */
  --clr-white:          #ffffff;
  --clr-bg:             #f4f7fb;
  --clr-text:           #222222;
  --clr-text-label:     #444444;
  --clr-text-muted:     #555555;
  --clr-text-light:     #888888;
  --clr-text-faint:     #999999;
  --clr-text-pale:      #aaaaaa;
  --clr-hero-title:     #1a2030;

  /* ── Borders ─────────────────────────────────────────────── */
  --clr-border:         #e8edf3;
  --clr-border-light:   #eef2f7;
  --clr-border-faint:   #eeeeee;
  --clr-timeline-track: #e0e8ef;

  /* ── Primary alpha tints ─────────────────────────────────── */
  --clr-primary-a08:    rgba(0,150,180,0.08);
  --clr-primary-a10:    rgba(0,150,180,0.10);
  --clr-primary-a20:    rgba(0,150,180,0.20);
  --clr-primary-a25:    rgba(0,150,180,0.25);
  --clr-accent-a25:     rgba(245,166,35,0.25);

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-xs:          0 1px 4px rgba(0,0,0,0.05);
  --shadow-card:        0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover:       0 8px 24px rgba(0,0,0,0.10);
  --shadow-nav-bottom:  0 1px 6px rgba(0,0,0,0.05);
  --shadow-nav-top:     0 -2px 12px rgba(0,0,0,0.08);
  --shadow-fab:         0 3px 10px rgba(0,150,180,0.35);
  --shadow-focus:       0 0 0 0.18rem rgba(0,150,180,0.20);
  --shadow-current:     0 0 0 4px rgba(245,166,35,0.25);

  /* ── Border-radius ───────────────────────────────────────── */
  --radius-input:       7px;
  --radius-card:        10px;
  --radius-auth:        14px;
  --radius-fab:         14px;
  --radius-icon:        9px;
  --radius-badge:       6px;
  --radius-sidebar:     8px;
  --radius-circle:      50%;

  /* ── Icon / element sizes ────────────────────────────────── */
  --size-icon:          40px;
  --size-icon-lg:       42px;
  --size-timeline-icon: 40px;
  --size-timeline-dot:  9px;
  --size-step-num:      42px;
  --size-app-icon:      40px;

  /* ── Layout ──────────────────────────────────────────────── */
  --sidebar-w:          220px;
  --dash-nav-h:         54px;
  --safe-bottom:        env(safe-area-inset-bottom, 0px);

  /* ── Typography ──────────────────────────────────────────── */
  --font-main:    'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-base:      0.9rem;
  --fs-body:      0.875rem;
  --fs-sm:        0.8rem;
  --fs-xs:        0.775rem;
  --fs-xxs:       0.75rem;
  --fs-tiny:      0.7rem;
  --fs-nav-label: 0.65rem;

  /* ── Inputs ──────────────────────────────────────────────── */
  --input-py:     0.38rem;
  --input-px:     0.6rem;
  --input-min-h:  38px;

  /* ── Spacing ─────────────────────────────────────────────── */
  --space-xs: 0.35rem;
  --space-sm: 0.6rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;

  /* ── Transitions ─────────────────────────────────────────── */
  --ease-fast: 0.15s ease;
  --ease-med:  0.20s ease;
  --ease-slow: 0.30s ease;

  /* ── Z-index ─────────────────────────────────────────────── */
  --z-nav:        100;
  --z-mobile-nav: 200;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-main);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: var(--fs-base);
  line-height: 1.55;
}

a { color: var(--clr-primary); }
a:hover { color: var(--clr-primary-dark); }

/* ── Mobile-first heading scale ─────────────────────────── */
h1, .h1 { font-size: clamp(1.35rem, 5.5vw, 2.4rem);  line-height: 1.20; font-weight: 800; }
h2, .h2 { font-size: clamp(1.15rem, 4.5vw, 1.9rem);  line-height: 1.25; font-weight: 700; }
h3, .h3 { font-size: clamp(1rem,   3.8vw, 1.55rem);  line-height: 1.30; font-weight: 700; }
h4, .h4 { font-size: clamp(0.92rem,3.2vw, 1.3rem);   line-height: 1.35; font-weight: 600; }
h5, .h5 { font-size: clamp(0.85rem,2.8vw, 1.1rem);   line-height: 1.40; font-weight: 600; }
h6, .h6 { font-size: clamp(0.80rem,2.4vw, 0.95rem);  line-height: 1.45; font-weight: 600; }

/* ============================================================
   UTILITY
   ============================================================ */
.min-w-0   { min-width: 0; }
.min-vh-80 { min-height: 80vh; }

.text-primary          { color: var(--clr-primary) !important; }
.bg-primary            { background: var(--clr-primary) !important; }
.bg-primary-subtle     { background: var(--clr-primary-a08) !important; }
.border-primary-subtle { border-color: var(--clr-primary-a25) !important; }
.text-primary-subtle   { color: var(--clr-primary) !important; }

.btn-primary           { background: var(--clr-primary); border-color: var(--clr-primary); }
.btn-primary:hover,
.btn-primary:focus     { background: var(--clr-primary-dark); border-color: var(--clr-primary-dark); }

.dsd-logo { object-fit: contain; }

/* ============================================================
   FORMS — tighter inputs, consistent across every page
   ============================================================ */
.form-control,
.form-select {
  padding: var(--input-py) var(--input-px);
  font-size: var(--fs-body);
  line-height: 1.5;
  min-height: var(--input-min-h);
  border-radius: var(--radius-input);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--clr-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}
.input-group .form-control { border-radius: var(--radius-input) 0 0 var(--radius-input); }
.input-group .btn {
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  padding: var(--input-py) var(--space-sm);
  font-size: var(--fs-body);
}

.form-label {
  font-weight: 500;
  font-size: var(--fs-sm);
  margin-bottom: var(--space-xs);
  color: var(--clr-text-label);
}
.form-text       { font-size: var(--fs-xxs); margin-top: 0.2rem; }
.form-check-label { font-size: var(--fs-body); }

/* Buttons */
.btn        { font-size: var(--fs-body); padding: 0.4rem 1rem;   border-radius: var(--radius-input); }
.btn-sm     { font-size: var(--fs-sm);   padding: 0.3rem 0.7rem; }
.btn-lg     { font-size: 0.95rem;        padding: 0.55rem 1.2rem; }

.btn.loading .btn-text    { opacity: 0.6; }
.btn.loading .btn-spinner { display: inline-block !important; }

/* ============================================================
   PUBLIC NAVBAR
   ============================================================ */
.dsd-navbar {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: var(--shadow-nav-bottom);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}
.dsd-brand-name {
  font-weight: 700;
  font-size: var(--fs-md, 1rem);
  color: var(--clr-primary);
  letter-spacing: 0.3px;
}

/* ============================================================
   HERO
   ============================================================ */
.dsd-hero {
  padding: 36px 0 30px;
  background: linear-gradient(140deg, var(--clr-bg) 0%, #e8f4f8 100%);
}
@media (min-width: 768px) {
  .dsd-hero { padding: 56px 0 48px; }
}
.dsd-hero-title {
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--clr-hero-title);
}
.dsd-hero-sub {
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  color: var(--clr-text-muted);
  line-height: 1.65;
  max-width: 520px;
  margin-top: 0.6rem;
}

/* Hero mock cards */
.dsd-hero-graphic { position: relative; width: 300px; height: 185px; }
.dsd-hero-card {
  position: absolute;
  background: var(--clr-white);
  border-radius: var(--radius-card);
  padding: 16px;
  width: 220px;
  box-shadow: var(--shadow-card);
}
.dsd-hero-card-2 { top: 70px; left: 150px; width: 210px; }
.dsd-status-dot  { width: var(--size-timeline-dot); height: var(--size-timeline-dot); border-radius: var(--radius-circle); flex-shrink: 0; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.dsd-step-card {
  background: var(--clr-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
  transition: transform var(--ease-med), box-shadow var(--ease-med);
}
.dsd-step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.dsd-step-num {
  width:  var(--size-step-num);
  height: var(--size-step-num);
  background: var(--clr-primary);
  color: var(--clr-white);
  border-radius: var(--radius-circle);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 auto;
}

/* ============================================================
   SERVICES GRID
   ============================================================ */
.dsd-service-card {
  background: var(--clr-white);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--clr-border-light);
  transition: transform var(--ease-med), box-shadow var(--ease-med);
}
.dsd-service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.dsd-service-icon {
  width:  var(--size-icon);
  height: var(--size-icon);
  background: var(--clr-primary-a10);
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  color: var(--clr-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.dsd-footer {
  background: var(--clr-white);
  border-top: 1px solid var(--clr-border);
  padding: 36px 0 24px;
  font-size: var(--fs-sm);
}
.footer-link {
  color: var(--clr-text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-sm);
}
.footer-link:hover { color: var(--clr-primary); }

/* ============================================================
   AUTH PAGES — mobile-first
   ============================================================ */
.dsd-auth-section {
  min-height: calc(100dvh - 120px);
  display: flex;
  align-items: flex-start;
  padding: 20px 0 40px;
}
@media (min-width: 576px) {
  .dsd-auth-section { align-items: center; padding: 32px 0; }
}

.dsd-auth-card {
  background: var(--clr-white);
  border-radius: var(--radius-auth);
  padding: 24px 18px;
  border: 1px solid var(--clr-border);
  width: 100%;
}
@media (min-width: 480px) { .dsd-auth-card { padding: 28px 24px; } }
@media (min-width: 768px) { .dsd-auth-card { padding: 32px 30px; } }

.dsd-auth-card .dsd-logo   { height: 44px !important; }
@media (min-width: 576px) {
  .dsd-auth-card .dsd-logo { height: 52px !important; }
}
.dsd-auth-card h4          { font-size: clamp(1rem, 4vw, 1.25rem); }
.dsd-auth-card p.text-muted { font-size: var(--fs-sm); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dsd-dashboard-body {
  background: var(--clr-bg);
  min-height: 100dvh;
}

.dsd-dash-nav {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  height: var(--dash-nav-h);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}
.dsd-dash-wrapper {
  display: flex;
  min-height: calc(100dvh - var(--dash-nav-h));
}

.dsd-sidebar {
  width: var(--sidebar-w);
  background: var(--clr-white);
  border-right: 1px solid var(--clr-border);
  padding: 18px 10px;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  position: sticky;
  top: var(--dash-nav-h);
  height: calc(100dvh - var(--dash-nav-h));
  overflow-y: auto;
}
.dsd-sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.dsd-sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sidebar);
  color: var(--clr-text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--ease-fast), color var(--ease-fast);
}
.dsd-sidebar-link i          { font-size: 1rem; width: 18px; text-align: center; }
.dsd-sidebar-link:hover      { background: var(--clr-bg); color: var(--clr-primary); }
.dsd-sidebar-link.active     { background: var(--clr-primary-a10); color: var(--clr-primary); font-weight: 600; }
.dsd-sidebar-footer          { padding-top: 10px; border-top: 1px solid var(--clr-border-faint); margin-top: auto; }

.dsd-main-content {
  flex: 1;
  padding: 16px 14px calc(96px + var(--safe-bottom));
  min-width: 0;
}
@media (min-width: 992px) {
  .dsd-main-content { padding: 28px 28px 28px; }
}
.dsd-main-content h5 { font-size: clamp(0.9rem, 3vw, 1.05rem); }

.dsd-main-content .card-body { padding: 16px 14px; }
@media (min-width: 576px) {
  .dsd-main-content .card-body { padding: 20px 18px; }
}

/* ============================================================
   MOBILE BOTTOM NAV — floating FAB centre
   ============================================================ */
.dsd-mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--clr-white);
  border-top: 1px solid var(--clr-border);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 8px calc(8px + var(--safe-bottom));
  z-index: var(--z-mobile-nav);
  box-shadow: var(--shadow-nav-top);
  overflow: visible; /* allow FAB to pop above */
}

.dsd-mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  color: var(--clr-text-faint);
  text-decoration: none;
  font-size: var(--fs-nav-label);
  font-weight: 500;
  gap: 3px;
  padding: 8px 4px;
  position: relative;
  transition: color var(--ease-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dsd-mobile-nav-link i     { font-size: 1.25rem; line-height: 1; }
.dsd-mobile-nav-link span  { display: block; }

/* Coloured top-bar indicator on active side items */
.dsd-mobile-nav-link.active:not(.dsd-mobile-fab) { color: var(--clr-primary); }
.dsd-mobile-nav-link.active:not(.dsd-mobile-fab)::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--clr-primary);
  border-radius: 0 0 4px 4px;
}

/* Centre floating FAB */
.dsd-mobile-fab {
  flex: 0 0 auto;
  padding: 0 12px calc(8px + var(--safe-bottom));
  margin-top: -18px; /* pop above bar */
  color: var(--clr-text-faint);
}
.dsd-fab-circle {
  width: 52px; height: 52px;
  background: var(--clr-primary);
  border-radius: var(--radius-circle);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-white);
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: var(--shadow-fab);
  border: 3px solid var(--clr-white);
  transition: background var(--ease-fast), transform var(--ease-fast);
  margin-bottom: 4px;
}
.dsd-mobile-fab span { font-size: var(--fs-nav-label); color: var(--clr-text-faint); }
.dsd-mobile-fab:hover .dsd-fab-circle,
.dsd-mobile-fab.active .dsd-fab-circle {
  background: var(--clr-primary-dark);
  transform: scale(1.07);
}
.dsd-mobile-fab.active span { color: var(--clr-primary); }

/* ============================================================
   APPLICATION CARDS
   ============================================================ */
.dsd-app-card {
  border-radius: var(--radius-card);
  transition: transform var(--ease-fast), box-shadow var(--ease-fast);
  border: 1px solid var(--clr-border-light) !important;
}
.dsd-app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover) !important; }

.dsd-app-icon {
  width:  var(--size-app-icon);
  height: var(--size-app-icon);
  flex-shrink: 0;
  background: var(--clr-primary-a10);
  border-radius: var(--radius-icon);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-primary);
  font-size: 1.1rem;
}
.dsd-app-card .fw-semibold { font-size: var(--fs-body); }
.dsd-app-card .small       { font-size: var(--fs-xs); }

/* Empty state */
.dsd-empty-state { padding: 44px 20px; }
.dsd-empty-icon  { font-size: 3.2rem; color: var(--clr-timeline-track); }

/* ============================================================
   STATUS TIMELINE
   ============================================================ */
.dsd-timeline {
  display: flex;
  position: relative;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.dsd-timeline::before {
  content: '';
  position: absolute;
  top: 20px; left: 20px; right: 20px;
  height: 2px;
  background: var(--clr-timeline-track);
  z-index: 0;
}
.dsd-timeline-step {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; text-align: center;
  position: relative; z-index: 1;
  padding: 0 6px;
  min-width: 72px;
}
.dsd-timeline-icon {
  width:  var(--size-timeline-icon);
  height: var(--size-timeline-icon);
  border-radius: var(--radius-circle);
  background: var(--clr-timeline-track);
  color: var(--clr-text-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  border: 3px solid var(--clr-white);
  transition: background var(--ease-slow), color var(--ease-slow);
  flex-shrink: 0;
}
.dsd-timeline-body          { margin-top: 8px; }
.dsd-timeline-body strong   { font-size: var(--fs-xxs); }
.dsd-timeline-body small    { font-size: var(--fs-tiny); }

.dsd-timeline-step.done .dsd-timeline-icon {
  background: var(--clr-primary);
  color: var(--clr-white);
}
.dsd-timeline-step.current .dsd-timeline-icon {
  background: var(--clr-accent);
  color: var(--clr-white);
  box-shadow: var(--shadow-current);
}

/* ============================================================
   BADGES, ALERTS
   ============================================================ */
.badge { font-size: var(--fs-tiny); padding: 0.3em 0.55em; font-weight: 600; border-radius: var(--radius-badge); }
.alert { font-size: var(--fs-body); padding: 0.6rem 0.8rem; border-radius: var(--radius-sidebar); }

/* ============================================================
   SECTION SPACING
   ============================================================ */
section.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
@media (min-width: 768px) {
  section.py-5 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
}
