:root {
  --brand: #417505;
  --brand-dark: #1f4f26;
  --brand-soft: #eaf4ec;
  --ink: #1f2933;
  --muted: #64748b;
  --line: #d9e2ec;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: 'Montserrat', Arial, sans-serif !important;
  line-height: 1.5;
}

body::-webkit-scrollbar,
.scroll-panel::-webkit-scrollbar,
#free_slots::-webkit-scrollbar,
#sidebar::-webkit-scrollbar {
  width: 7px;
}

body::-webkit-scrollbar-track,
.scroll-panel::-webkit-scrollbar-track,
#free_slots::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track {
  background: #ffffff;
}

body::-webkit-scrollbar-thumb,
.scroll-panel::-webkit-scrollbar-thumb,
#free_slots::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb {
  background-color: var(--brand);
  border-radius: 7px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--brand);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.16);
}

.app-nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 70px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(280px, auto) minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 8px;
  background: #ffffff;
}

.logo {
  width: 138px;
  max-width: 42vw;
  height: auto;
}

.header-title {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0;
  justify-self: center;
  text-align: center;
  line-height: 1.2;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 1px rgba(31, 41, 51, 0.16);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switcher a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  text-decoration: none;
}

.language-switcher a.active {
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: 0 5px 16px rgba(31, 41, 51, 0.18);
}

.app-flashes {
  width: min(960px, calc(100% - 32px));
  margin: 16px auto 0;
}

.app-alert {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.result-panel {
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.result-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--brand);
}

.result-panel-success::before {
  background: var(--brand);
}

.result-panel-warning::before {
  background: #b7791f;
}

.result-panel-error::before {
  background: var(--danger);
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.result-panel-warning .result-icon {
  background: #fff7e6;
  color: #8a4b0f;
}

.result-panel-error .result-icon {
  background: #fdecec;
  color: var(--danger);
}

.result-alert {
  max-width: 720px;
  margin: 18px auto 0;
  font-weight: 600;
}

.result-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
}

.result-panel-compact {
  max-width: 760px;
}

.result-panel-compact .result-shell {
  padding: 18px 20px 20px;
}

.result-panel-compact .result-icon {
  margin-bottom: 10px;
}

.result-panel-compact .page-title {
  margin-bottom: 8px;
}

.result-panel-compact .page-subtitle {
  max-width: 560px;
}

.result-panel-compact .result-message,
.result-panel-compact .existing-appointment-card,
.result-panel-compact .result-actions {
  margin-top: 18px;
}

.result-panel .page-title {
  max-width: 640px;
  margin: 8px auto 12px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.12;
}

.result-panel .page-subtitle {
  max-width: 620px;
  margin: 0 auto;
  font-size: 0.98rem;
}

.result-message {
  display: grid;
  gap: 7px;
  max-width: 600px;
  margin: 24px auto 0;
  padding: 18px 20px;
  border-radius: 8px;
  text-align: left;
}

.result-message span {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-message strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.result-message-error {
  border: 1px solid #f2b8b5;
  background: #fff5f5;
}

.result-message-error span {
  color: var(--danger);
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.result-actions .btn {
  min-width: 190px;
}

.existing-appointment-card {
  max-width: 680px;
  margin: 24px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: left;
}

.existing-appointment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.existing-appointment-header h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.62);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.section-card,
.hero-panel,
.info-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.hero-copy {
  padding: clamp(24px, 5vw, 56px);
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-title {
  margin: 8px 0 12px;
  color: var(--ink);
  font-size: clamp(1.5rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.08;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-control,
.gj-textbox-md {
  min-height: 48px;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  color: var(--ink);
  font-size: 0.95rem !important;
}

.form-control:focus,
.gj-textbox-md:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 0.2rem rgba(47, 111, 53, 0.14) !important;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-success {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-success:hover,
.btn-success:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline-success {
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline-success:hover {
  background: var(--brand);
  border-color: var(--brand);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-value {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.location-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.arrow_icon {
  width: 30px;
  height: 30px;
}

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

.slot-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.slot-booking-card {
  overflow: hidden;
}

.slot-media-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.slot-copy {
  margin-bottom: 22px;
}

.slot-heading {
  margin: 14px 0 0;
  max-width: 680px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}

.gj-datepicker {
  width: min(360px, 100%) !important;
}

.gj-datepicker .form-control {
  width: calc(100% - 48px) !important;
}

.slot-button {
  width: min(180px, 100%);
  min-height: 48px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-dark);
}

.slot-button:hover,
.slot-button:focus {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.status-card,
.reservation-card {
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}

.status-card-header {
  padding: 22px;
  background: var(--brand);
  color: #ffffff;
  text-align: center;
}

.status-card-body {
  padding: 24px;
}

.reservation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf7 100%);
}

.reservation-card-header h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
}

.reservation-card-body {
  padding: 24px;
}

.reservation-intro {
  max-width: 720px;
}

.reservation-intro p:last-child {
  margin-bottom: 0;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill-success {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-pill-warning {
  background: #fff7e6;
  color: #8a4b0f;
}

.visit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.manage-panel,
.followup-panel {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.manage-panel-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 22px;
}

.manage-panel-header h2 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 700;
}

.manage-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manage-action {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.manage-action h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.manage-action p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.manage-action .btn {
  width: 100%;
}

.manage-action-warning {
  background: #fffaf0;
}

.confirmation-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: left;
}

.progress-strip,
.status-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brand-dark);
  font-weight: 700;
}

.status-flow {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  gap: 12px;
}

.status-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-marker {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 6px #ffffff;
}

.status-step.is-complete {
  color: var(--brand-dark);
}

.status-step.is-complete .status-marker {
  border-color: var(--brand);
  background: var(--brand);
}

.status-step.is-warning {
  color: #8a4b0f;
}

.status-step.is-warning .status-marker {
  border-color: #b7791f;
  background: #b7791f;
}

.status-connector {
  flex: 1;
  max-width: 150px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
}

.progress-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
}

.progress-line {
  width: min(180px, 28vw);
  height: 5px;
  border-radius: 999px;
  background: var(--brand);
}

#map {
  min-height: 320px;
  border-radius: 8px;
}

#sidebar {
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 767.98px) {
  .app-nav {
    width: min(100% - 24px, 1120px);
    min-height: 104px;
    grid-template-columns: max-content auto;
    gap: 10px 12px;
    padding: 12px 0;
  }

  .logo {
    width: 128px;
    max-width: 52vw;
  }

  .header-title {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-self: center;
    text-align: center;
    font-size: 0.94rem;
    padding: 7px 12px;
  }

  .language-switcher {
    justify-self: end;
  }

  .language-switcher a {
    min-width: 40px;
    height: 32px;
  }

  .page-shell {
    width: min(100% - 24px, 1120px);
    margin-top: 16px;
  }

  .hero-image {
    min-height: 190px;
  }

  .hero-copy {
    padding: 22px;
  }

  .detail-grid,
  .location-summary,
  .reservation-detail-grid,
  .visit-summary {
    grid-template-columns: 1fr;
  }

  .reservation-card-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .reservation-card-body {
    padding: 20px;
  }

  .status-pill {
    width: 100%;
  }

  .status-flow {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    max-width: 260px;
  }

  .status-step {
    justify-content: flex-start;
  }

  .status-connector {
    width: 3px;
    height: 28px;
    margin-left: 12px;
    background: linear-gradient(180deg, var(--brand), var(--brand-soft));
  }

  .location-summary .arrow_icon {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .slot-list {
    height: auto;
    max-height: 360px;
  }

  .slot-button {
    width: 100%;
  }

  .slot-media-image {
    height: 180px;
  }

  .slot-copy {
    margin-bottom: 18px;
  }

  .slot-heading {
    font-size: 1.35rem;
    line-height: 1.28;
  }

  .slot-booking-card {
    padding: 20px !important;
  }

  .gj-datepicker {
    width: 100% !important;
  }

  .result-icon {
    width: 46px;
    height: 46px;
  }

  .result-shell {
    padding: 26px 18px;
  }

  .result-panel-compact .result-shell {
    padding: 22px 16px 24px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .existing-appointment-card {
    padding: 16px;
  }

  .existing-appointment-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .back-button {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }

  .back-text {
    display: none;
  }

  .back-icon {
    font-size: 1.35rem;
  }

  .manage-actions {
    grid-template-columns: 1fr;
  }

  .manage-action {
    min-height: auto;
  }

  .confirmation-footer {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }
}
