:root {
  --bg: #F6F3EE;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f8fafc;
  --border: #e2e8f0;

  --text: #16313D;
  --muted: #6B7280;

  --primary: #3CB179;
  --primary-hover: #2f9c67;

  --secondary: #1F4B5C;
  --secondary-hover: #16313D;

  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #38bdf8;

  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 16px;

  --topbar-offset: 108px;
}

html {
  scroll-padding-top: calc(var(--topbar-offset) + 16px);
}

body {
  padding-top: var(--topbar-offset);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  background: #F6F3EE;
  color: var(--text);
  font-family: 'Manrope', Arial, sans-serif;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(246, 243, 238, 0.78), rgba(246, 243, 238, 0.78)),
    url("img/map.png") center center / cover no-repeat;
  opacity: 1;
  z-index: 0;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.container,
.screen,
.public-profile-container,
.public-profile-card,
.card,
.provider-card,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
  will-change: transform;
}

body.topbar-hidden .topbar {
  transform: translateY(-100%);
}

body.topbar-scrolled .topbar {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
}

.password-toggle:hover {
  color: var(--text);
}

.auth-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.link-btn {
  border: none;
  background: transparent;
  color: #16a34a;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-btn {
  border: none;
  background: rgba(0,0,0,0.03);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  transition: 0.2s;
}

.nav-btn:hover {
  background: rgba(0,0,0,0.06);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  position: relative;
  background: linear-gradient(135deg, #1F4B5C, #3CB179);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 24px;
  color: white;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
}

.tag {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34,197,94,0.15);
  color: #86efac;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  transition: 0.25s;
  margin-bottom: 20px;
  position: relative;
}

.card:hover {
  box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}

.card::before {
  content: "";
  position: absolute;
  height: 4px;
  width: 40px;
  background: #3CB179;
  border-radius: 4px;
  top: 0;
  left: 16px;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #475569;
  font-size: 0.95rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  padding: 14px 14px;
  border-radius: 14px;
  outline: none;
  transition: border 0.2s, transform 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(60,177,121,0.15);
}

.grid-2,
.grid-3,
.stats-grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: minmax(280px, 1.35fr) repeat(4, minmax(140px, 1fr));
  margin-bottom: 10px;
  align-items: stretch;
}

#screen-dashboard > .card {
  margin-bottom: 14px;
}

.stat-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.stats-grid > .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stats-grid > .card .actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.stats-grid > .card .btn,
.stats-grid > .card .btn-secondary {
  flex: 1 1 160px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-card strong {
  font-size: 1.4rem;
}

.btn {
  border-radius: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #3CB179, #2f9c67);
  color: white;
  font-weight: 600;
  transition: 0.25s;
  box-shadow: 0 6px 14px rgba(60,177,121,0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(60,177,121,0.35);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-whatsapp {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: white;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 700;
}

.btn-whatsapp:hover {
  filter: brightness(1.05);
}

.w-full {
  width: 100%;
}

.actions,
.actions-end {
  display: flex;
  gap: 12px;
  align-items: center;
}

.actions-end {
  justify-content: flex-end;
}

.location-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(60,177,121,0.1);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
}

.results-header,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-section-header .btn {
  flex-shrink: 0;
}

.providers-list {
  display: grid;
  gap: 16px;
}

.provider-card {
  background: white;
  border-left: 4px solid #3CB179;
  border-radius: 18px;
  padding: 18px;
  transition: 0.25s;
}

.provider-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.provider-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.provider-name {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.provider-service {
  margin: 0;
  color: var(--muted);
}

.provider-description {
  color: #334155;
  margin: 14px 0;
  line-height: 1.55;
}

.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(60,177,121,0.1);
  border: none;
  color: #1F4B5C;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
}

.badge-boost {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.badge-emergency {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.provider-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.5;
  white-space: normal;
}

.alert-success {
  background: rgba(34,197,94,0.12);
  color: #166534;
  border-color: rgba(34,197,94,0.24);
}

.alert-error {
  background: rgba(239,68,68,0.12);
  color: #991b1b;
  border-color: rgba(239,68,68,0.24);
}

.alert-info {
  background: rgba(56,189,248,0.12);
  color: #0c4a6e;
  border-color: rgba(56,189,248,0.24);
}

.muted {
  color: var(--muted);
}

.check {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  color: var(--text);
}

.response-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(255,255,255,0.06);
}

.response-message {
  margin: 0 0 12px;
  color: #dbe3ee;
  line-height: 1.5;
}

.response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.inline-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  padding: 14px;
  border-radius: 14px;
  outline: none;
  resize: vertical;
}

.small-muted {
  font-size: 0.9rem;
  color: var(--muted);
}

.legal-page h2 {
  margin-bottom: 8px;
}

.legal-page h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.legal-page p,
.legal-page li {
  color: #334155;
  line-height: 1.7;
}

.legal-page ul {
  margin: 0 0 16px 18px;
  padding: 0;
}

.legal-page li {
  margin-bottom: 8px;
}

.legal-accept-box {
  margin: 12px 0 18px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.check-legal {
  align-items: flex-start;
}

.check-legal input {
  margin-top: 4px;
}

.check-legal a,
.footer a {
  color: #3CB179;
  font-weight: 500;
  text-decoration: none;
  transition: 0.2s;
}

.check-legal a:hover,
.footer a:hover {
  color: #1F4B5C;
  text-decoration: underline;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 24px;
  padding: 22px 18px 18px;
  border-top: 1px solid rgba(22, 49, 61, 0.10);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

.footer-legal {
  margin-bottom: 14px;
}

.footer-legal p {
  color: #52606d;
  line-height: 1.65;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 8px;
}

.footer-links a:hover {
  background: rgba(60,177,121,0.10);
}

.footer .small-muted {
  color: #52606d;
}

.autocomplete-field {
  position: relative;
}

.autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  z-index: 30;
}

.autocomplete-item {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(255,255,255,0.06);
}

.autocomplete-item-empty {
  padding: 12px 14px;
  color: var(--muted);
}

.actions-profile-edit {
  flex-wrap: wrap;
}

.actions-profile-edit .btn {
  flex: 1 1 180px;
}

#profileServiceHint {
  margin-top: 2px;
}

#formChangePassword .btn[disabled],
#formProfile .btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.public-profile-container {
  display: grid;
  gap: 18px;
}

.public-profile-card {
  display: grid;
  gap: 18px;
}

.public-profile-header {
  background: linear-gradient(135deg, #1F4B5C, #3CB179);
  color: white;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.10);
}

.public-profile-header h2 {
  margin: 10px 0 8px;
  font-size: 2rem;
  line-height: 1.1;
  word-break: break-word;
}

.public-profile-services {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 1rem;
  line-height: 1.5;
  word-break: break-word;
}

.public-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

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

.search-actions {
  flex-wrap: wrap;
}

.search-empty-card {
  text-align: left;
}

.search-empty-card h3 {
  margin-bottom: 10px;
}

.search-empty-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

#searchLocationHelp {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

.urgent-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.urgent-actions .btn {
  flex: 1 1 220px;
}

.urgent-location-box {
  margin-top: 18px;
}

#urgentLocationHelp {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

#screen-urgent .card {
  margin-bottom: 24px;
}

#screen-urgent textarea {
  min-height: 120px;
  resize: vertical;
}

#urgentResponsesList,
#providerUrgentCallsList {
  display: grid;
  gap: 16px;
}

.urgent-empty-card {
  padding-top: 26px;
  padding-bottom: 26px;
}

#passwordRecoveryNotice {
  margin-bottom: 14px;
}

#formChangePassword .small-muted,
#screen-login .auth-links {
  line-height: 1.5;
}

.link-btn[disabled],
.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.inline-service-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.service-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(60, 177, 121, 0.10);
  border: 1px solid rgba(60, 177, 121, 0.18);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  max-width: 100%;
}

.service-tag span {
  word-break: break-word;
}

.service-tag-remove {
  border: none;
  background: transparent;
  color: var(--secondary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.public-rating-card {
  display: grid;
  gap: 14px;
}

.public-rating-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  gap: 10px;
}

.public-rating-option {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 16px;
  min-height: 58px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
  font-weight: 700;
}

.public-rating-option:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(60,177,121,0.12);
  transform: translateY(-1px);
}

.public-rating-option.active {
  background: linear-gradient(135deg, #3CB179, #2f9c67);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(60,177,121,0.22);
}

.public-rating-arrow {
  opacity: 0.35;
  transition: 0.2s;
}

.public-rating-option.active .public-rating-arrow {
  opacity: 1;
  transform: translateX(1px);
}

.public-rating-locked {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
}

.nav-btn[disabled],
.btn[disabled],
.link-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none !important;
}

#btnLogout[disabled] {
  min-width: 92px;
}

#btnBuyBoost[disabled],
#btnBuySubscription[disabled],
#btnRefreshPlan[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none !important;
}

.urgent-response-form textarea[disabled] {
  opacity: 0.75;
  cursor: not-allowed;
}

.urgent-response-form .btn[disabled] {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

#providerUrgentCallsList,
#urgentResponsesList {
  display: grid;
  gap: 16px;
}

.urgent-empty-card {
  padding-top: 24px;
  padding-bottom: 24px;
}







@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-offset: 148px;
  }

  .topbar {
    padding: 10px 16px 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 1.15rem;
  }

  .brand p {
    font-size: 0.82rem;
    margin-top: 2px;
  }

  .topnav {
    width: 100%;
    gap: 10px;
  }

  .topnav .nav-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
    min-height: 44px;
  }

  .results-header,
  .dashboard-header,
  .dashboard-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .grid-2,
  .grid-3,
  .stats-grid,
  .public-profile-grid {
    grid-template-columns: 1fr;
  }

  .provider-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .provider-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .provider-actions .btn,
  .provider-actions a.btn {
    width: 100%;
    justify-content: center;
  }

  .public-profile-header {
    padding: 22px 18px;
  }

  .public-profile-header h2 {
    font-size: 1.6rem;
  }

  .container {
    width: min(100% - 20px, 1180px);
  }

  .card {
    padding: 18px;
  }

  .inline-service-add {
    grid-template-columns: 1fr;
  }

  .inline-service-add .btn {
    width: 100%;
  }

  .footer {
    width: min(100% - 20px, 1180px);
    margin: 28px auto 18px;
    padding: 18px 14px 16px;
  }

  .footer-links {
    gap: 10px;
  }
}

@media (max-width: 560px) {
  :root {
    --topbar-offset: 300px;
  }

  .topnav .nav-btn {
    flex: 1 1 100%;
  }

  .hero {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .hero h2 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .public-profile-header h2 {
    font-size: 1.45rem;
  }

  .meta-pill,
  .badge {
    font-size: 0.82rem;
    padding: 7px 9px;
  }

  .field input,
  .field textarea,
  .field select {
    padding: 13px 12px;
  }

  .public-rating-selector {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .public-rating-option {
    min-height: 52px;
    padding: 8px 4px;
    font-size: 0.95rem;
  }
}