/* Main application styles */
/* Government Color Palette - Override Tabler defaults */
:root {
  --tblr-primary: #005373;
  --tblr-primary-rgb: 0, 83, 115;
  --tblr-secondary: #6c757d;
  --tblr-success: #14b8a6;
  --tblr-info: #0088bf;
  --tblr-warning: #f59e0b;
  --tblr-danger: #ef4444;
}

/* Remove any debug/development borders */
input,
textarea,
select,
.form-control,
.form-check-input,
.form-select {
  border-style: solid !important;
}

/* Ensure form elements don't have red dashed borders */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  border-color: var(--tblr-border-color) !important;
}

/* Touch-friendly controls (WCAG 2.2) */
.btn {
  min-height: 44px;
  min-width: 44px;
}

.form-control {
  min-height: 44px;
}

/* Ensure focus states are visible for accessibility */
.nav-link:focus,
.navbar-brand:focus {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

/* Government-appropriate adjustments */
.page-header {
  background: linear-gradient(135deg, var(--tblr-primary) 0%, #006d99 100%);
}

/* Ensure hero section connects seamlessly to navbar */
main {
  margin-top: 0;
  padding-top: 0;
}

main > .page-header:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Admin page-header should have white text by default */
.page-header .page-title,
.page-header .text-secondary {
  color: rgba(255, 255, 255, 0.9);
}

.page-header .text-white-75 {
  color: rgba(255, 255, 255, 0.75);
}

/* Remove white bar above admin page-header */
.page-wrapper .page-header {
  margin-top: 0 !important;
}

/* Ensure page-wrapper doesn't create white space above header */
.page-wrapper {
  background-color: var(--tblr-bg-surface, #ffffff);
}

/* Warning button (orange) - Used for primary CTAs on public site */
.btn-warning {
    font-weight: 600;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.25);
}

/* Badge contrast improvements - ensure all badges have readable text */
.badge {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

/* Force proper contrast on all badge variants */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-info,
.badge.bg-danger {
  color: #ffffff !important;
}

.badge.bg-warning,
.badge.bg-light,
.badge.bg-secondary {
  color: #1a1a1a !important;
}

/* Badge size on mobile */
@media (max-width: 767.98px) {
  .badge {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
  }
}

/* Homepage section improvements */
.section-heading {
    font-weight: 700;
    color: var(--tblr-primary);
}

/* Improve text contrast for readability */
.text-body {
  color: #1a1a1a !important;
}

.card-text.text-body {
  color: #333333 !important;
}

/* Ensure sufficient contrast on card titles */
.card-title {
  color: #1a1a1a;
  font-weight: 600;
}

/* Mobile section spacing - tighter on mobile */
@media (max-width: 767.98px) {
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .display-6 {
    font-size: 1.75rem;
  }
}

/* Mobile hero section - prevent text overflow */
@media (max-width: 575.98px) {
  .page-header .display-4 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  .page-header .lead {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  
  .page-header .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Ensure buttons stack properly on mobile */
  .page-header .d-md-flex {
    flex-direction: column !important;
  }
  
  .page-header .btn-lg {
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem !important;
  }
}

/* Tablet hero adjustments */
@media (min-width: 576px) and (max-width: 767.98px) {
  .page-header .display-4 {
    font-size: 2.25rem !important;
  }
}


/* Consent list styling */
.consent-list {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.consent-list li {
    margin-bottom: 0.5rem;
}

/* Income total prominence */
#totalIncomeDisplay {
    color: #005373;
    transition: color 0.3s;
}

#totalIncomeDisplay.over-limit {
    color: #d63939;
}

#totalIncomeDisplay.under-limit {
    color: #2fb344;
}

/* Print-friendly styles */
@media print {
    .btn, .navbar, .progress, .no-print {
        display: none !important;
    }

    .card {
        border: none;
        box-shadow: none;
    }

    body {
        background: white;
    }
}
