/* ============================================================
   Find a Tender – Front-end Styles
   ============================================================ */

:root {
  --fat-primary: #1d70b8; /* GOV.UK blue */
  --fat-primary-dk: #003078;
  --fat-green: #00703c;
  --fat-red: #d4351c;
  --fat-amber: #f47738;
  --fat-grey-lt: #f3f2f1;
  --fat-grey: #b1b4b6;
  --fat-grey-dk: #505a5f;
  --fat-text: #0b0c0c;
  --fat-radius: 4px;
  --fat-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---- Search Form ---- */
.fat-search-wrap {
  margin-bottom: 2rem;
}
.fat-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.fat-form-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
}
.fat-group-keyword {
  flex: 2 1 260px;
}
.fat-group-submit {
  flex: 0 0 auto;
}
.fat-form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fat-text);
  margin-bottom: 4px;
}
.fat-form-group input[type="search"],
.fat-form-group select {
  padding: 10px 12px;
  border: 2px solid #0b0c0c;
  border-radius: var(--fat-radius);
  font-size: 1rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.fat-form-group input[type="search"]:focus,
.fat-form-group select:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  border-color: #0b0c0c;
}

/* ---- Buttons ---- */
.fat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: var(--fat-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.fat-btn-primary {
  background: var(--fat-primary);
  color: #fff;
}
.fat-btn-primary:hover {
  background: var(--fat-primary-dk);
  color: #fff;
}
.fat-btn-secondary {
  background: #fff;
  color: var(--fat-primary);
  border-color: var(--fat-primary);
}
.fat-btn-secondary:hover {
  background: var(--fat-grey-lt);
}
.fat-btn-ghost {
  background: transparent;
  color: var(--fat-grey-dk);
  border-color: var(--fat-grey);
}
.fat-btn-ghost:hover {
  background: var(--fat-grey-lt);
}
.fat-btn-lg {
  padding: 14px 24px;
  font-size: 1.0625rem;
}

/* Spinner inside button */
.fat-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fat-spin 0.6s linear infinite;
}
.fat-loading .fat-spinner {
  display: inline-block;
}
.fat-loading .fat-btn-text {
  display: none;
}
@keyframes fat-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Badges ---- */
.fat-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fat-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fat-badge-active {
  background: #cce2d8;
  color: var(--fat-green);
}
.fat-badge-planned {
  background: #dde8f5;
  color: var(--fat-primary-dk);
}
.fat-badge-complete {
  background: #e8e8e8;
  color: #505050;
}
.fat-badge-cancelled {
  background: #fcd9d4;
  color: var(--fat-red);
}
.fat-badge-stage {
  background: #fff3cd;
  color: #6c4800;
}

/* ---- Tender Card (listing) ---- */
.fat-tender-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-left: 4px solid var(--fat-primary);
  border-radius: var(--fat-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--fat-shadow);
  transition: box-shadow 0.2s;
}
.fat-tender-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.fat-status-active {
  border-left-color: var(--fat-green);
}
.fat-status-cancelled {
  border-left-color: var(--fat-red);
}
.fat-status-complete {
  border-left-color: var(--fat-grey);
}

.fat-card-title {
  margin: 0 0 12px;
  font-size: 1.125rem;
}
.fat-card-title a {
  color: var(--fat-primary);
  text-decoration: none;
}
.fat-card-title a:hover {
  text-decoration: underline;
}

.fat-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 12px;
}
.fat-meta-item {
  display: flex;
  flex-direction: column;
}
.fat-meta-label {
  font-size: 0.75rem;
  color: var(--fat-grey-dk);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fat-meta-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fat-text);
}

.fat-card-excerpt {
  color: var(--fat-grey-dk);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.fat-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--fat-grey-lt);
}
.fat-notice-id {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--fat-grey-dk);
}

/* ---- Pagination ---- */
.fat-pagination {
  margin-top: 24px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fat-page-btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--fat-grey);
  border-radius: var(--fat-radius);
  color: var(--fat-primary);
  text-decoration: none;
  font-size: 0.9rem;
}
.fat-page-btn:hover,
.fat-page-active {
  background: var(--fat-primary);
  color: #fff;
  border-color: var(--fat-primary);
}

/* ---- Single Tender ---- */
.fat-single-tender {
  max-width: 820px;
}
.fat-single-header {
  margin-bottom: 2rem;
}
.fat-single-title {
  font-size: 1.75rem;
  margin: 12px 0 6px;
  line-height: 1.25;
}
.fat-notice-ref {
  color: var(--fat-grey-dk);
  font-size: 0.875rem;
  margin: 0;
}

.fat-section {
  margin-bottom: 2.5rem;
}
.fat-section h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--fat-grey-lt);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.fat-dl {
  margin: 0;
}
.fat-dl-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--fat-grey-lt);
}
.fat-dl-row:last-child {
  border-bottom: none;
}
.fat-dl-row dt {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--fat-grey-dk);
}
.fat-dl-row dd {
  margin: 0;
  font-size: 0.9375rem;
}

.fat-description {
  line-height: 1.7;
  white-space: pre-wrap;
}

.fat-cpv-list {
  padding-left: 1.25rem;
  margin: 0;
}
.fat-cpv-list li {
  margin-bottom: 4px;
  font-size: 0.9375rem;
}

.fat-award-section .fat-dl {
  background: #f0f8f0;
  border-radius: var(--fat-radius);
  padding: 0 16px;
}

.fat-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Misc ---- */
.fat-no-results {
  color: var(--fat-grey-dk);
  font-style: italic;
  padding: 24px 0;
}
.fat-error {
  color: var(--fat-red);
  background: #fcd9d4;
  padding: 12px 16px;
  border-radius: var(--fat-radius);
}

/* Responsive */

/* Responsive */
@media (max-width: 600px) {
  .fat-dl-row {
    grid-template-columns: 1fr;
  }
  .fat-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .fat-notice-id {
    margin-left: 0;
  }
  .fat-single-title {
    font-size: 1.375rem;
  }
}
