@import url("header.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: #f5f6f8;
}

.btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-ghost {
  color: #344054;
  background: transparent;
  border-color: #d0d5dd;
}

.btn-ghost:hover {
  background: #f9fafb;
  border-color: #98a2b3;
}

.btn-primary {
  color: #fff;
  background: #c41e3a;
  border-color: #c41e3a;
}

.btn-primary:hover {
  background: #a31830;
  border-color: #a31830;
}

.page-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 5.5rem;
}

.sidebar-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 1.25rem;
  /* box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06); */
}

.sidebar-heading {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #101828;
  letter-spacing: -0.02em;
}

.filter-group {
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
}

.filter-group legend,
.filter-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.9375rem;
  color: #344054;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-option:hover {
  background: #f9fafb;
}

.filter-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #c41e3a;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-option:has(input:checked) {
  background: rgba(196, 30, 58, 0.06);
  color: #101828;
  font-weight: 500;
}

.filter-select {
  width: 100%;
  padding: 0.625rem 2rem 0.625rem 0.75rem;
  font-size: 0.9375rem;
  color: #1a1a1a;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select:hover {
  border-color: #d0d5dd;
}

.filter-select:focus {
  border-color: #c41e3a;
  /* box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12); */
}

.btn-block {
  width: 100%;
  margin-top: 0.25rem;
}

.sidebar-clear {
  border-radius: 8px;
}

.mainpostings {
  min-width: 0;
}

.recentlyposted {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recentlyposted .sidebar-card h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #101828;
}

.recentlyposted .sidebar-card p {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #475467;
}

.recentlyposted .sidebar-card .btn {
  margin-top: 0.25rem;
}

.auth-page {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-lead {
  margin: -0.5rem 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #475467;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  margin: 0;
}

.forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: #c41e3a;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.fp-login-link {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #c41e3a;
  font-weight: 600;
  text-decoration: none;
  text-align: right;
}
.fp-login-link:hover { text-decoration: underline; }

.auth-input {
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  outline: none;
}

.auth-input:hover {
  border-color: #d0d5dd;
}

.auth-input:focus {
  border-color: #c41e3a;
}

.auth-error {
  margin: 0 0 1rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 8px;
}

.auth-divider {
  margin: 1.25rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #98a2b3;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-footer {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  color: #475467;
  text-align: center;
}

.auth-footer a {
  color: #c41e3a;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.create-layout {
  align-items: start;
}

.create-tips {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #475467;
}

.create-tips li + li {
  margin-top: 0.5rem;
}

.post-preview-card {
  margin-top: 1rem;
}

.post-preview-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #101828;
}

.post-preview-body {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #475467;
}

.post-preview-pay {
  margin: 0;
  font-size: 1rem;
  color: #475467;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.form-section {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section-title {
  margin: 0 0 0.25rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-textarea {
  resize: vertical;
  min-height: 8rem;
  margin-top: 0.375rem;
}

.form-hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: #98a2b3;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.form-actions-post {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0.5rem;
}

.btn-post {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

.form-actions .btn {
  text-decoration: none;
}

.form-success {
  margin: 0 0 1rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .sidebar {
    position: static;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions:not(.form-actions-post) {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Welcome Banner ---------- */

.welcome-banner {
  background: #fff;
  border-bottom: 1px solid #e4e7ec;
}

.welcome-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.welcome-text {
  max-width: 560px;
}

.welcome-heading {
  margin: 0 0 0.75rem;
  font-size: 1.875rem;
  font-weight: 700;
  color: #101828;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.welcome-sub {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #475467;
}

.welcome-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.welcome-stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
}

.welcome-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c41e3a;
  letter-spacing: -0.02em;
}

.welcome-stat-label {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: #667085;
}

@media (max-width: 768px) {
  .welcome-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .welcome-heading {
    font-size: 1.375rem;
  }

  .welcome-stats {
    gap: 1.5rem;
  }
}

/* ---------- Sign-up Page ---------- */

/* Password strength indicator */
.strength-bar-track {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.strength-segment {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: #e4e7ec;
  transition: background 0.25s;
}

.strength-segment.active-weak   { background: #f04438; }
.strength-segment.active-fair   { background: #f79009; }
.strength-segment.active-good   { background: #12b76a; }
.strength-segment.active-strong { background: #027a48; }

.strength-label {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: #98a2b3;
  min-height: 1.25em;
  transition: color 0.2s;
}

.strength-label.weak   { color: #f04438; }
.strength-label.fair   { color: #f79009; }
.strength-label.good   { color: #12b76a; }
.strength-label.strong { color: #027a48; }

/* Match icon inside confirm field */
.input-wrapper {
  position: relative;
  margin-top: 0.375rem;
}

.input-wrapper .auth-input {
  margin-top: 0;
  padding-right: 2.25rem;
  width: 100%;
}

.match-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.match-icon.visible { opacity: 1; }

/* Google button with logo */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.btn-google svg {
  flex-shrink: 0;
}

.auth-field-optional {
  font-weight: 400;
  color: #98a2b3;
  text-transform: none;
  letter-spacing: 0;
}

/* Post feed cards */
.post-card-title a {
  color: #101828;
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 600;
}
.post-card-title a:hover { color: #c41e3a; }

.post-card-body {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #475467;
}

.post-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #667085;
}

.post-card-time {
  font-size: 0.8125rem;
  color: #98a2b3;
}

.posts-load-more {
  margin-top: 1rem;
}

.post-card-btn { margin-top: 0.25rem; }

.posts-status {
  font-size: 0.9375rem;
  color: #667085;
  padding: 1rem 0;
}

.post-load-error { color: #b42318; font-size: 0.9375rem; }
