/* Centralized wizard styles extracted from templates/registration/wizard
   Includes: wizard-progress, choice-card, tag-input and related styles */
:root {
  --wizard-accent-1: #d2b48c;
  --wizard-accent-2: #bc9a6a;
  --wizard-neutral: #f1e4d3;
  --wizard-text: #6f4f28;
  --wizard-error: #dc3545;
  --wizard-error-light: #fff5f5;
  --wizard-section-bg: #fafaf8;
  --wizard-note-bg: #f5f3f0;
}

/* ===== Wizard Progress ===== */
.wizard-progress {
  position: relative;
}

.wizard-progress-step {
  flex: 1;
  text-align: center;
}

.wizard-progress-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--wizard-neutral);
  color: var(--wizard-text);
  font-weight: 600;
  margin-bottom: 0.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.wizard-progress-title {
  display: block;
  font-size: 0.8rem;
  color: #8c6a3d;
  margin-top: 0.25rem;
}

.wizard-progress-step.active .wizard-progress-index {
  background: linear-gradient(135deg, var(--wizard-accent-1), var(--wizard-accent-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(188, 154, 106, 0.35);
}

.wizard-progress-step.completed .wizard-progress-index {
  background: linear-gradient(135deg, #7fb77e, #4c956c);
  color: #fff;
}

.wizard-progress-step.skipped .wizard-progress-index {
  background: linear-gradient(135deg, #ffe08a, #f3b942);
  color: #5f4312;
}

.wizard-progress-step.active .wizard-progress-title {
  color: var(--wizard-text);
  font-weight: 600;
}

.wizard-progress-bar {
  flex: 0 0 40px;
  height: 4px;
  margin: 0 6px;
  background-color: #e9d9c3;
  border-radius: 999px;
}

.wizard-progress-bar.completed {
  background: linear-gradient(135deg, var(--wizard-accent-1), var(--wizard-accent-2));
}

/* ===== Wizard Card ===== */
.wizard-card {
  border: none;
  box-shadow: 0 24px 50px rgba(188, 154, 106, 0.18);
  border-radius: 16px;
  overflow: hidden;
}

.wizard-card .card-header {
  border: none;
  background-color: var(--wizard-accent-2);
  color: #fff;
}

.wizard-card .card-body {
  padding: 2rem 2rem;
}

.wizard-step-header {
  background-color: #fff;
  border: none;
  padding: 2.25rem 2rem 1.5rem;
  text-align: center;
}

.wizard-step-header .wizard-heading {
  font-weight: 700;
  color: var(--wizard-text);
  margin-bottom: 0.75rem;
  font-size: 1.6rem;
}

.wizard-step-header p {
  color: #8c6a3d;
  margin: 0 auto;
  max-width: 28rem;
  line-height: 1.6;
}

.password-input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.password-toggle-btn.is-active {
  background-color: rgba(210, 180, 140, 0.15);
  border-color: rgba(210, 180, 140, 0.4);
  color: var(--wizard-text);
}

.password-toggle-btn:focus {
  box-shadow: var(--focus-ring);
}

@media (max-width: 767.98px) {
  .wizard-card .card-body {
    padding: 0 1.5rem 1.75rem;
  }

  .wizard-step-header {
    padding: 1.8rem 1.25rem 1.25rem;
  }

  .wizard-step-header .wizard-heading {
    font-size: 1.35rem;
  }
}

/* ===== Detail Section (New) ===== */

.detail-section:hover {
  box-shadow: 0 4px 12px rgba(188, 154, 106, 0.08);
}

.detail-section:has(.is-invalid) {
  background: var(--wizard-error-light);
  border-left-color: var(--wizard-error);
}


.detail-section:has(.is-invalid) .section-title {
  border-bottom-color: var(--wizard-error);
}

.section-icon,
.wizard-heading-icon {
  display: none;
}

/* ===== Section Note (New) ===== */
.section-note {
  font-size: 0.9rem;
  color: #8c6a3d;
  margin-bottom: 1.25rem;
  background: var(--wizard-note-bg);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 2px solid var(--wizard-accent-2);
  line-height: 1.5;
}

/* ===== Form Group Enhancements ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label[class="font-weight-semibold"] {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.form-group label .text-danger {
  font-size: 1.2em;
  color: var(--wizard-error);
  font-weight: bold;
  line-height: 1;
}

/* ===== Form Text (Helper & Counter) ===== */
.form-text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.form-text.text-muted {
  color: #8c6a3d !important;
}

/* Character Counter Styles */
.counter-display {
  font-weight: 600;
  color: #6f4f28;
  transition: color 0.2s ease;
}

.counter-display.counter-warning {
  color: #ff9800;
  animation: pulse-warning 0.3s ease;
}

.counter-display.counter-error {
  color: var(--wizard-error);
  animation: pulse-error 0.3s ease;
}

.counter-status {
  color: #8c6a3d;
  font-style: italic;
}

.counter-status.text-warning {
  color: #ff9800;
  font-weight: 500;
}

.counter-status.text-danger {
  color: var(--wizard-error);
  font-weight: 600;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-error {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

[data-counter-target] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Choice Card Grid ===== */
.choice-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.choice-card-item {
  position: relative;
  display: block;
}

.choice-card-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  inset: 0;
  width: 100%;
  height: 100%;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 2px solid #d4c5b0;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  color: var(--wizard-text);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  font-weight: 500;
  min-height: 84px;
  position: relative;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  width: 100%;
  height: 100%;
}

.choice-card:hover {
  border-color: var(--wizard-accent-2);
  box-shadow: 0 6px 16px rgba(188, 154, 106, 0.18);
  transform: translateY(-2px);
  background: #fafaf8;
}

.choice-card-input:focus-visible + .choice-card,
.choice-card.focus-ring {
  outline: 3px solid var(--wizard-accent-2);
  outline-offset: 2px;
  border-radius: 12px;
}

.choice-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  pointer-events: none;
}

.choice-card-label {
  font-weight: 600;
  color: inherit;
}

.choice-card-check {
  color: transparent;
  transition: all 0.25s ease;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  opacity: 0;
}

.choice-card.active {
  background: linear-gradient(135deg, #d9a574 0%, #bc9a6a 100%);
  color: #fff;
  border-color: #bc9a6a;
  box-shadow: 0 8px 20px rgba(188, 154, 106, 0.25);
  transform: translateY(-2px);
}

.choice-card.active .choice-card-label {
  color: #fff;
  font-weight: 700;
}

.choice-card.active .choice-card-check {
  color: #fff;
  opacity: 1;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== Service area controls ===== */
.service-area-filter {
  max-width: 220px;
}

.service-area-filter select {
  border-radius: 10px;
  padding-left: 0.75rem;
  padding-right: 2.25rem;
}

.service-area-filter select:focus {
  box-shadow: 0 0 0 3px rgba(188, 154, 106, 0.25);
  border-color: var(--wizard-accent-2);
}

.service-area-picker {
  margin-top: 1rem;
  border: 1px solid rgba(210, 180, 140, 0.35);
  border-radius: 12px;
  max-height: 360px;
  overflow: auto;
  background: #fff;
}

.service-area-group {
  border-bottom: 1px solid rgba(210, 180, 140, 0.25);
}

.service-area-group:last-child {
  border-bottom: none;
}

.service-area-group-toggle {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  font-weight: 600;
  color: var(--wizard-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.service-area-group-toggle:hover,
.service-area-group-toggle:focus {
  background: rgba(210, 180, 140, 0.12);
}

.service-area-group-panel {
  display: none;
  padding: 0 1rem 1rem;
}

.service-area-group-panel.open {
  display: block;
}

.service-area-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem 1.25rem;
}

.service-area-city {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
}

.service-area-city input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.service-area-summary {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-area-summary.is-empty {
  display: none;
}

.service-area-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: rgba(210, 180, 140, 0.2);
  color: var(--wizard-text);
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(210, 180, 140, 0.4);
}

.service-area-chip button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.service-area-chip button:hover,
.service-area-chip button:focus {
  color: #8a6332;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Location Selector (Choices.js) ===== */
.location-selector {
  margin-bottom: 1rem;
}

/* Choices.js Container */
.choices {
  margin-bottom: 0;
}

.choices__inner {
  background-color: #fff;
  border: 1px solid rgba(210, 180, 140, 0.4);
  border-radius: 10px;
  padding: 0.5rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.choices:focus-within .choices__inner {
  border-color: var(--wizard-accent-2);
  box-shadow: 0 0 0 3px rgba(210, 180, 140, 0.2);
}

.choices.is-open .choices__inner {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Choices Items (Pills/Tags) */
.choices__item {
  background: linear-gradient(135deg, #d9a574 0%, #bc9a6a 100%);
  color: #fff;
  border-color: #bc9a6a;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  margin: 0.25rem;
}

.choices__item--selectable {
  cursor: pointer;
}

.choices__item--selectable:hover {
  box-shadow: 0 4px 8px rgba(188, 154, 106, 0.25);
}

/* Remove Button */
.choices__button {
  color: #fff;
  font-weight: bold;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.choices__button:hover {
  opacity: 1;
}

/* Input */
.choices__input {
  background-color: transparent;
  border: none;
  color: #6f4f28;
  padding: 0.35rem;
  font-size: 0.95rem;
}

.choices__input::placeholder {
  color: #b38a5c;
  opacity: 0.7;
}

.choices__input:focus {
  outline: none;
}

/* Dropdown List */
.choices__list {
  border: 1px solid rgba(210, 180, 140, 0.4);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background-color: #fff;
  max-height: 300px;
  overflow-y: auto;
}

.choices__list--dropdown {
  z-index: 10;
}

/* Dropdown Options */
.choices__item {
  padding: 0.75rem 1rem;
  color: #6f4f28;
  background-color: #fff;
  border: none;
}

.choices__item:hover,
.choices__item--selectable:hover {
  background-color: #fafaf8;
  color: var(--wizard-accent-2);
}

.choices__item:focus {
  outline: 2px solid var(--wizard-accent-2);
  outline-offset: -2px;
}

.choices__item.is-selected {
  background-color: rgba(210, 180, 140, 0.15);
  color: var(--wizard-text);
}

/* No Options Message */
.choices__no-results,
.choices__group-heading {
  color: #8c6a3d;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.tag-input-base {
  min-height: 46px;
  margin-bottom: 0.5rem;
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 1px solid rgba(210, 180, 140, 0.4);
  border-radius: 10px;
  padding: 0.4rem;
  background: #fff;
  transition: all 0.2s ease;
}

.tag-input:focus-within {
  border-color: var(--wizard-accent-2);
  box-shadow: 0 0 0 3px rgba(210, 180, 140, 0.2);
}

.tag-input.tag-input-error {
  border-color: var(--wizard-error);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-item {
  background: #f5dcc1;
  color: #5f3f1e;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tag-remove {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  transition: color 0.2s ease;
}

.tag-remove:hover {
  color: #8a6332;
}

.tag-editor {
  flex: 1 0 120px;
  border: none;
  min-width: 120px;
  padding: 0.25rem;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
}

.tag-editor::placeholder {
  color: #b38a5c;
}

/* ===== Validation Feedback (New) ===== */
.form-group:has(.is-invalid) {
  background: var(--wizard-error-light);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 4px solid var(--wizard-error);
}

.form-group .invalid-feedback {
  color: var(--wizard-error);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.form-group .invalid-feedback::before {
  content: "⚠";
  font-weight: bold;
  font-size: 1.1em;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== Wizard Actions ===== */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9d9c3;
}

.wizard-actions .left-actions {
  flex: 1;
}

.wizard-actions .right-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ===== Button States (New) ===== */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 1);
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

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

/* ===== List Group Item ===== */
.list-group-item {
  border: 1px solid var(--wizard-neutral);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.25s ease;
}

.list-group-item:hover {
  border-color: var(--wizard-accent-1);
  box-shadow: 0 8px 18px rgba(188, 154, 106, 0.16);
}

.list-group-item.active {
  background: linear-gradient(135deg, var(--wizard-accent-1), var(--wizard-accent-2));
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(188, 154, 106, 0.35);
}

.list-group-item.active .font-weight-semibold,
.list-group-item.active small {
  color: #fff !important;
}

/* ===== Badge & Link ===== */
.badge.badge-secondary {
  background-color: var(--wizard-neutral);
  color: var(--wizard-text);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

.btn-link {
  color: var(--wizard-accent-2);
  transition: color 0.2s ease;
}

.btn-link:hover,
.btn-link:focus {
  color: #9c7c52;
  text-decoration: none;
}

/* ===== Alert Variants ===== */
.alert-info {
  background-color: #f8efe3;
  border-color: #f0dfc5;
  color: var(--wizard-text);
  border-left: 4px solid var(--wizard-accent-1);
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffe69c;
  color: #664d03;
  border-left: 4px solid #ffc107;
}

.alert-danger {
  background-color: #fff5f5;
  border-color: #f5a6a6;
  color: var(--wizard-error);
  border-left: 4px solid var(--wizard-error);
}

/* ===== Responsive Design ===== */
@media (max-width: 1199.98px) {
  .detail-section {
    padding: 1.25rem;
  }

  .choice-card-row {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.8rem;
  }

  .choice-card {
    min-height: 75px;
  }
}

@media (max-width: 991.98px) {
  .detail-section {
    padding: 1.15rem;
    margin-bottom: 1.5rem;
  }

  .choice-card-row {
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.25rem;
  }

  .choice-card {
    min-height: 72px;
    font-size: 0.9rem;
    padding: 0.9rem;
  }

  .choice-card-label {
    font-size: 0.9rem;
  }

  .wizard-actions {
    gap: 0.75rem;
  }

  .wizard-actions .right-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 767.98px) {
  .detail-section {
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .section-note {
    font-size: 0.85rem;
    padding: 0.6rem;
    margin-bottom: 1rem;
  }

  .choice-card-row {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .choice-card {
    padding: 0.75rem;
    min-height: 70px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .choice-card-label {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .choice-card-check {
    font-size: 1rem;
    width: 20px;
    height: 20px;
  }

  .form-row {
    margin-left: 0;
    margin-right: 0;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .wizard-actions {
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
  }

  .wizard-actions .left-actions {
    width: 100%;
  }

  .wizard-actions .right-actions {
    width: 100%;
    justify-content: stretch;
  }

  .wizard-actions button {
    flex: 1;
  }

  .tag-input {
    padding: 0.35rem;
  }

  .tag-item {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
}

@media (max-width: 575.98px) {
  .detail-section {
    padding: 0.9rem;
  }

  .section-title {
    font-size: 0.95rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.4rem;
  }

  .section-note {
    font-size: 0.8rem;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
  }

  .choice-card-row {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
  }

  .choice-card {
    padding: 0.6rem 0.5rem;
    min-height: 65px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .choice-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .choice-card-check {
    font-size: 0.9rem;
    width: 18px;
    height: 18px;
  }

  .form-group label[class="font-weight-semibold"] {
    gap: 0.35rem;
  }

  .form-group label .text-danger {
    font-size: 1.1em;
  }

  .form-text {
    font-size: 0.8rem;
  }

  .wizard-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.45rem 0.8rem;
  }
}
.service-area-group.hidden {
  display: none;
}
