/* =========================
   global.css – Helpal
   ========================= */

/* Design Tokens */
:root {
  --primary-color: #111C44;
  --primary-dark: #0b1535;
  --secondary-color: #0f766e;
  --success-color: #0f766e;
  --warning-color: #f8961e;
  --danger-color: #f94144;
  --info-color: #43aa8b;

  --gray-50: #f8f9fa;
  --gray-100: #e9ecef;
  --gray-200: #dee2e6;
  --gray-300: #ced4da;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;
  --gray-600: #495057;
  --gray-700: #343a40;
  --gray-800: #212529;
  --gray-900: #111c44;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;

  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1);
  --surface-canvas: var(--brand-bg, #f7f5f0);
  --surface-card: var(--brand-surface, #ffffff);
  --surface-cool: var(--brand-surface-alt, #edf3f8);
  --surface-warm: #fcfaf5;
  --surface-blue: #f2f6fb;
  --surface-border: var(--brand-border, #d9e3ec);
}

/* Reset + base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-family);
  color: var(--gray-800);
  background:
    radial-gradient(circle at top left, rgba(17, 28, 68, 0.06), transparent 26%),
    radial-gradient(circle at top right, rgba(198, 146, 20, 0.08), transparent 18%),
    linear-gradient(180deg, var(--surface-canvas) 0%, #f9f7f2 48%, #f3f7fb 100%);
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.main-content {
  min-height: calc(100vh - 180px);
  padding: var(--spacing-6) 0;
  position: relative;
}

@media (max-width: 768px) {
  .main-content { padding: var(--spacing-4) 0; }
}

/* Accessibility */
:focus-visible {
  outline: 3px solid rgba(17, 28, 68, 0.22);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Utilities */
.avatar-circle-sm, .avatar-circle-md, .avatar-circle-lg {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.avatar-circle-sm { width: 32px; height: 32px; font-size: var(--font-size-sm); }
.avatar-circle-md { width: 48px; height: 48px; font-size: var(--font-size-base); }
.avatar-circle-lg { width: 64px; height: 64px; font-size: var(--font-size-lg); }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-open {
  background-color: rgba(17, 28, 68, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(17, 28, 68, 0.2);
}
.status-in_progress {
  background-color: rgba(76, 201, 240, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(76, 201, 240, 0.2);
}
.status-submitted {
  background-color: rgba(248, 150, 30, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(248, 150, 30, 0.2);
}
.status-completed {
  background-color: rgba(67, 170, 139, 0.1);
  color: var(--info-color);
  border: 1px solid rgba(67, 170, 139, 0.2);
}
.status-pending {
  background-color: rgba(108, 117, 125, 0.1);
  color: var(--gray-600);
  border: 1px solid rgba(108, 117, 125, 0.2);
}

/* Cards */
.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease; }
@media (hover: hover) and (pointer: fine) {
  .card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
}

.card,
.modal-content,
.list-group-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 250, 245, 0.94));
  border-color: var(--surface-border);
}

/* Forms */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(17, 28, 68, 0.18);
}

/* Buttons (keep bootstrap, but align theme) */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Footer */
.helpal-footer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 243, 236, 0.96));
  border-top: 1px solid rgba(217, 227, 236, 0.9);
}
.footer-mark {
  width: 36px; height: 36px;
  border-radius: var(--radius-lg);
  background: var(--primary-color);
  box-shadow: var(--shadow-sm);
}
.footer-link {
  color: var(--gray-700);
  text-decoration: none;
  font-size: var(--font-size-sm);
}
.footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}
.helpal-footer-cta {
  background:
    linear-gradient(180deg, rgba(237, 243, 248, 0.82), rgba(252, 250, 245, 0.92));
  border-top: 1px solid rgba(217, 227, 236, 0.72);
}
.helpal-footer-cta__actions .btn {
  min-width: 120px;
  white-space: nowrap;
}

.promo-public-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #111c44 0%, #17325f 55%, #0f4c5c 100%);
  color: #fff;
  box-shadow: 0 20px 40px rgba(17, 28, 68, 0.18);
}

.promo-public-card__media-link,
.promo-public-card__image {
  display: block;
  width: 100%;
}

.promo-public-card__image {
  border-radius: 1rem;
  object-fit: cover;
  max-height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.promo-public-card__body {
  position: relative;
  z-index: 1;
  max-width: 52rem;
}

.promo-public-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  padding: 0.32rem 0.78rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promo-public-card__title {
  margin: 0 0 0.55rem;
  color: #fff;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
}

.promo-public-card__copy {
  margin: 0;
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.7;
}

.promo-public-card__cta {
  margin-top: 1rem;
}

.promo-public-card--footer {
  padding: 1.15rem 1.25rem;
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(135deg, #111c44 0%, #17325f 100%);
}

.promo-public-card--footer .promo-public-card__title {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.promo-public-card--footer .promo-public-card__copy {
  font-size: 0.96rem;
}

@media (max-width: 767.98px) {
  .promo-public-card {
    padding: 1.1rem;
    border-radius: 1.1rem;
  }

  .promo-public-card__copy {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .promo-public-card__image {
    max-height: 220px;
  }
}

@media (max-width: 575.98px) {
  .helpal-footer-cta__actions {
    width: 100%;
  }

  .helpal-footer-cta__actions .btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
  }
}

/* =========================
   GLOBAL FAB (FIXED)
   ========================= */

/* Always render the button; control visibility via media queries */
.helpal-fab {
  position: fixed;
  right: var(--spacing-6);
  bottom: var(--spacing-6);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  box-shadow: var(--shadow-xl);
  display: none;               /* default off */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000; /* above navbar (1030) + most app content */
  transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}

.helpal-fab i {
  font-size: 1.25rem;          /* icon size */
  line-height: 1;
}

/* Country confirmation modal */
.country-confirm-modal .modal-dialog {
  max-width: 410px;
}

.country-confirm-modal .modal-content {
  border-radius: 1.35rem;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff);
  border: 1px solid rgba(17, 28, 68, 0.08);
  box-shadow: 0 30px 60px rgba(17, 28, 68, 0.18) !important;
}

.country-confirm-modal__accent {
  height: 4px;
  background: linear-gradient(90deg, #111c44, #3558b1);
}

.country-confirm-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: rgba(17, 28, 68, 0.08);
  color: #111c44;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.country-confirm-modal .modal-header,
.country-confirm-modal .modal-body,
.country-confirm-modal .modal-footer {
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}

.country-confirm-modal .modal-header {
  padding-top: 1.15rem;
}

.country-confirm-modal .modal-body {
  padding-top: 0.7rem;
  padding-bottom: 0.8rem;
}

.country-confirm-modal .modal-footer {
  padding-top: 0.15rem;
  padding-bottom: 1.15rem;
  gap: 0.65rem;
}

.country-confirm-modal .btn-close {
  margin: 0;
  opacity: 0.65;
}

.country-confirm-modal .btn-close:hover {
  opacity: 1;
}

.country-confirm-modal__copy {
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 32ch;
}

.country-confirm-modal .form-label {
  color: #111c44;
}

.country-confirm-modal .form-select {
  min-height: 48px;
  border-radius: 0.9rem;
  border-color: rgba(17, 28, 68, 0.12);
  box-shadow: none;
}

.country-confirm-modal .form-select:focus {
  border-color: rgba(17, 28, 68, 0.32);
  box-shadow: 0 0 0 0.2rem rgba(17, 28, 68, 0.10);
}

.country-confirm-modal .form-text {
  color: #64748b;
  line-height: 1.45;
}

.country-confirm-modal .modal-footer .btn {
  min-width: 120px;
  border-radius: 999px;
}

@media (max-width: 575.98px) {
  .country-confirm-modal .modal-dialog {
    max-width: calc(100vw - 1.2rem);
    margin: 0.6rem auto;
  }

  .country-confirm-modal .modal-footer .btn {
    flex: 1 1 auto;
  }
}

.helpal-fab:hover { background: var(--primary-dark); transform: translateY(-2px); }
.helpal-fab:active { transform: translateY(0); }

/* Show FAB on tablet/mobile globally */
@media (max-width: 1024px) {
  .helpal-fab { display: flex; }
}

/* show on desktop too if you later want it */

@media (min-width: 1025px) {
  .helpal-fab { display: flex; opacity: .9; }
}


/* =========================
   Toast
   ========================= */
.helpal-toast {
  position: fixed;
  bottom: calc(var(--spacing-6) + 70px);
  right: var(--spacing-6);
  background: #fff;
  color: var(--gray-800);
  padding: var(--spacing-4) var(--spacing-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--success-color);
  z-index: 2100;
  max-width: 320px;
  animation: helpal-slide-in .25s ease, helpal-fade-out .25s ease 2.75s forwards;
}

.helpal-toast--error { border-left-color: var(--danger-color); }
.helpal-toast--warning { border-left-color: var(--warning-color); }
.helpal-toast--info { border-left-color: var(--primary-color); }

@keyframes helpal-slide-in {
  from { transform: translateX(12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes helpal-fade-out {
  to { opacity: 0; transform: translateX(12px); }
}
