/* ==========================================================================
   Post a request (post-a-request.html)
   Two-step flow: create an account, then fill in the request form.
   Design system: uses the shared tokens from /css/tokens.css, matching
   the redesign pass already done on the about/contact/post pages.
   ========================================================================== */

body {
  font-family: "Inter", sans-serif;
  background: var(--surface);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

h1 {
  font-size: var(--font-size-2xl);
  text-align: center;
}

.page-title {
  font-weight: var(--font-weight-semibold);
  color: var(--dark);
}

h2 {
  font-size: var(--font-size-base);
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  h1 {
    font-size: var(--font-size-xl);
  }

  h2 {
    font-size: var(--font-size-sm);
  }

  .card {
    padding: var(--space-4);
    border-radius: 0;
  }
}

.form-section {
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   Home button (mobile navbar)
   ========================================================================== */
.home-btn {
  width: 56px;
  height: 56px;
  background: #dedfe0;
  border-radius: 50%;
  color: #000;
  text-decoration: none;
  margin-left: -5px;
  transition: all 0.2s ease;
}

.home-btn:hover {
  background-color: #e9ecef;
  color: #000;
  transform: scale(1.05);
}

.home-btn:active {
  transform: scale(0.95);
}

.home-btn i {
  font-size: 1.5rem;
  line-height: 1;
}

.home-text {
  font-size: 10px;
  line-height: 1;
  margin-top: 2px;
  color: #1f2937;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.main-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, var(--light) 0%, var(--surface) 100%);
  padding: var(--space-9) var(--space-9) var(--space-9) var(--space-9);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .main-container {
    padding: 0;
  }
}

@media (min-width: 992px) {
  .card {
    max-width: 650px;
    margin: 0 auto;
  }
}

.register-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.register-card h1 {
  text-align: center;
  margin-bottom: var(--space-5);
  color: var(--dark);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 768px) {
  .register-card {
    padding: var(--space-5) var(--space-4);
  }
}

/* ==========================================================================
   Form inputs
   ========================================================================== */
.input-group {
  position: relative;
  margin-bottom: var(--space-4);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  font-size: var(--font-size-base);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.input-group select:focus,
.input-group textarea:focus,
.input-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--focus-ring);
}

.mb-3 {
  margin-bottom: 0.2rem !important;
}

@media (max-width: 768px) {
  #categoryCheckboxes {
    margin: 10px 50px 10px 10px;
  }
}

.category-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  background-color: var(--surface-alt);
}

.category-checkboxes .form-check {
  flex: 1 1 45%;
  min-width: 140px;
}

/* Error messages */
.error-message {
  color: var(--danger);
  font-size: var(--font-size-sm);
  margin-top: 4px;
  display: block;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.3s;
}

.error-message.active {
  opacity: 1;
}

/* Login link */
.login-link {
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
}

.login-link a {
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.login-link a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Google sign-in button
   ========================================================================== */
.btn-google {
  background-color: var(--surface);
  color: #000;
  border: 2px solid #000;
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  width: 100%;
  margin-bottom: var(--space-5);
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.btn-google:hover {
  background-color: var(--surface-alt);
  transform: translateY(-1px);
}

.btn-google img,
.google-logo {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

@media (min-width: 992px) {
  .btn-google {
    max-width: 420px;
    margin: 0 auto var(--space-5) auto;
  }
}

/* OR separator */
.or-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
  gap: var(--space-3);
}

.or-container .line {
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.or-container .or-text {
  white-space: nowrap;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

.or-subtext {
  text-align: center;
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   Post-service form
   ========================================================================== */
#postServiceForm select,
#postServiceForm textarea {
  font-size: 0.95rem;
  width: 100%;
  padding: var(--space-3);
  box-sizing: border-box;
}

#postServiceForm input:not(.form-control):not([type="checkbox"]) {
  font-size: var(--font-size-base);
  padding: var(--space-2) var(--space-3);
  box-sizing: border-box;
}

#postServiceForm .form-floating > .form-control {
  height: 3rem;
  line-height: 1.4;
  font-size: var(--font-size-base);
  box-sizing: border-box;
}

#postServiceForm .form-floating > label {
  font-size: var(--font-size-sm);
}

#categoryCheckboxes {
  max-height: 350px;
  overflow-y: auto;
  font-size: 0.9em;
}

#categoryCheckboxes .form-check-label {
  font-size: var(--font-size-sm);
}

@media (min-width: 992px) {
  #categoryCheckboxes .form-check-label {
    font-size: var(--font-size-base);
  }

  #categorySearchContainer {
    margin-bottom: var(--space-4);
    width: 50%;
  }
}

#enterDescription.hide-placeholder::placeholder {
  color: transparent;
}

#enterDescription.hide-placeholder + label {
  opacity: 0;
  transition: opacity 0.2s;
}

#categoryCheckboxes .form-check-input,
#postServiceForm .form-check-input {
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
  transform: scale(0.85);
  opacity: 0.85;
}

.form-floating > label {
  padding: 0 var(--space-3);
}

.helper-note,
.address-note {
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  margin-bottom: 0 !important;
}

.address-note {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 5px;
  margin-left: -6px;
  line-height: 1.3;
  word-break: normal;
  white-space: nowrap;
}

/* Instagram / Facebook social icon buttons (official brand colors -- not
   tokenized, deliberately kept as-is for brand recognizability) */
.ig-icon {
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
  border-color: var(--border-color);
}

.ig-icon img {
  filter: brightness(0) invert(1);
}

.fb-icon {
  background-color: #1877f2;
  border-color: var(--border-color);
}

.fb-icon img {
  filter: brightness(0) invert(1);
}

.input-group-text {
  padding: 0.25rem 0.4rem !important;
}

.input-group .form-control,
.input-group .input-group-text {
  padding: 0.25rem 0.5rem;
  height: 40px;
  font-size: var(--font-size-sm);
}

.input-group-text img {
  width: 16px;
  height: 16px;
}

.selected-categories-wrap {
  margin-bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.category-search-wrap {
  margin-top: var(--space-3);
  position: relative;
  width: 100%;
}

#categorySearch {
  width: 100%;
  padding: var(--space-2) 2.5rem var(--space-2) var(--space-2);
  font-size: var(--font-size-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  height: 40px;
  box-sizing: border-box;
}

#categorySearch:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.category-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: none;
  padding: 10px;
  touch-action: manipulation;
}

.category-search-clear img {
  width: 28px;
  height: 28px;
  display: block;
}

.whatsapp-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.whatsapp-check .form-check-input {
  margin: 0;
  flex-shrink: 0;
}

.whatsapp-check .form-check-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.whatsapp-check img {
  width: 24px;
  height: 24px;
}

.signup-next-btn {
  display: block;
  margin: 0 auto;
}

.back-home-link {
  font-size: var(--font-size-sm);
  display: block;
  text-align: center;
  margin-top: var(--space-2);
  text-decoration: underline;
}

.submit-request-wrap {
  margin: 0 auto;
  max-width: 400px;
}

/* Was hardcoded to Facebook's brand blue (#1877f2) -- unrelated to
   Facebook, just an accidental copy-paste from the nearby .fb-icon rule.
   Uses the site's actual brand color now. */
.submit-request-btn {
  background-color: var(--primary);
  border-color: var(--primary);
}

.submit-request-btn:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

#selectedCategories span {
  background-color: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

#selectedCategories span button {
  border: none;
  background: transparent;
  color: #fff;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  padding: 0 2px;
  font-size: var(--font-size-base);
}

/* ==========================================================================
   "What happens next" panel
   ========================================================================== */
.step-one-intro-text {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

#howItWorksBlock {
  margin-top: var(--space-2);
}

.how-step-desc {
  color: var(--text-muted);
}

.mobile-break {
  display: none;
}

@media (max-width: 480px) {
  .mobile-break {
    display: inline;
  }
}

.signup-progress {
  margin: var(--space-3) 0 var(--space-4);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
  margin-bottom: 6px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  width: 50%;
  height: 100%;
  background: var(--cta-green-dark);
}

.progress-fill2 {
  width: 90%;
  height: 100%;
  background: var(--cta-green-dark);
}

.how-it-works {
  display: flex;
  flex-direction: column;
  color: var(--text-body);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  width: min(92%, 420px);
  margin: var(--space-3) -20px var(--space-3) 20px;
}

.how-it-works li {
  display: list-item;
}

.how-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--dark);
  text-align: center;
  margin: 0 0 10px 0;
}

.how-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 15px;
  font-weight: var(--font-weight-normal);
  margin: 0 0 10px 0;
}

.how-step:last-child {
  margin-bottom: 0;
}

.how-icon {
  font-size: var(--font-size-lg);
  line-height: 1;
  flex: 0 0 auto;
  margin-top: 2px;
}

.how-text {
  margin: 0;
  line-height: 1.35;
  font-size: 17px;
}

@media (max-width: 768px) {
  .how-it-works {
    background-color: transparent;
    box-shadow: none;
    width: 100%;
    padding: 6px 20px;
    margin: var(--space-3) -20px var(--space-3) auto;
  }

  .how-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
  }

  .how-step {
    font-size: 14.5px;
    margin-bottom: var(--space-2);
  }

  .how-icon {
    font-size: 15px;
  }

  .how-text {
    font-size: 20.5px;
  }
}

@media (min-width: 769px) {
  .how-it-works {
    margin: var(--space-4) 55px var(--space-4) auto;
  }
}

@media (min-width: 992px) {
  .how-it-works {
    width: min(70%, 460px);
    padding: 0 50px;
    border-radius: var(--radius-md);
  }

  .how-title {
    font-size: var(--font-size-lg);
  }

  .how-step {
    font-size: 15.5px;
  }

  .how-icon {
    font-size: 16px;
  }

  .how-text {
    font-size: 18.5px;
  }
}

/* ==========================================================================
   Password / username requirements checklist
   ========================================================================== */
.pw-requirements,
.un-requirements {
  display: none;
  margin-top: var(--space-3);
  padding: var(--space-3) 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  font-size: var(--font-size-sm);
}

.pw-requirements.show,
.un-requirements.show {
  display: block;
}

.pw-req,
.un-req {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 6px 0;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.pw-req.not-met,
.un-req.not-met {
  color: var(--danger);
}

.pw-req.not-met i,
.un-req.not-met i {
  color: var(--danger);
}

.pw-req.met,
.un-req.met {
  color: var(--success);
}

.pw-req.met i,
.un-req.met i {
  color: var(--success);
}

.pw-req i,
.un-req i {
  font-size: var(--font-size-base);
  min-width: 18px;
}

/* ==========================================================================
   Misc
   ========================================================================== */
.btn-spinner,
.btn-spinner-white {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-left: var(--space-2);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.btn-spinner {
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #111;
}

.btn-spinner-white {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-loading #registerSection,
.auth-loading #postServiceSection,
.auth-loading #stepOneIntro {
  display: none !important;
}
