/* Service requests — page shell (mirrors sell-wizard) + desktop modal */

.page-requests {
  --sr-ink: var(--text, #111114);
  --sr-muted: var(--text-muted, #6b7280);
  --sr-line: var(--border, rgba(17,17,20,0.1));
  --sr-bg: var(--bg, #f5f6f8);
  --sr-card: var(--surface, #ffffff);
  --sr-accent: var(--primary, #9a0002);
}

.page-requests .sr-page {
  background: var(--sr-bg);
  min-height: 70vh;
  padding: 1.25rem 0 3rem;
}

.page-requests .sr-shell {
  max-width: 760px;
}

.page-requests .sr-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-requests .sr-head h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 900;
  color: var(--sr-ink);
  margin: 0 0 0.25rem;
}

.page-requests .sr-head p {
  margin: 0;
  color: var(--sr-muted);
  font-size: 0.92rem;
}

.page-requests .sr-back {
  width: fit-content;
  color: var(--sr-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

.page-requests .sr-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.page-requests .sr-tab {
  flex: 0 0 auto;
  border: 1px solid var(--sr-line);
  background: var(--sr-card);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sr-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.page-requests .sr-tab.is-active {
  border-color: rgba(154, 0, 2, 0.35);
  color: var(--sr-ink);
}

.page-requests .sr-card {
  background: var(--sr-card);
  border: 1px solid var(--sr-line);
  border-radius: 16px;
  padding: 1.25rem;
}

.page-requests .sr-card h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--sr-ink);
}

.page-requests .sr-lead {
  color: var(--sr-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0 0 1rem;
}

.page-requests .sr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.page-requests .sr-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sr-ink);
}

.page-requests .sr-field--full {
  grid-column: 1 / -1;
}

.page-requests .sr-field input,
.page-requests .sr-field textarea,
.page-requests .sr-field select,
.page-requests .sr-field .sr-input {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--sr-line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
}

.page-requests .sr-field textarea {
  resize: vertical;
  min-height: 6rem;
}

.page-requests .sr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.page-requests .sr-nav .btn {
  min-width: 7rem;
}

.page-requests .sr-error,
.page-requests .sr-success {
  margin-top: 0.85rem;
  margin-bottom: 0;
  font-size: 0.88rem;
}

.page-requests .sr-sticky-nav {
  display: none;
}

/* Modal + shared form bits */
.sr-root .sr-form .select2-container {
  width: 100% !important;
}

.sr-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--bg);
  border-radius: 10px;
}

.sr-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.sr-tab.is-active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

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

.sr-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.sr-form textarea,
.sr-form .sr-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.sr-form textarea {
  resize: vertical;
  min-height: 96px;
}

.sr-form .sr-input:focus,
.sr-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.sr-error,
.sr-success {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

/* Select2 inside modal — above modal z-index */
.requests-modal ~ .select2-container--open,
.select2-container--open .select2-dropdown {
  z-index: 10060 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #9a0002 !important;
  color: #fff !important;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: #9a0002 !important;
  box-shadow: 0 0 0 2px rgba(154, 0, 2, 0.2) !important;
  outline: none !important;
}

/* Desktop modal */
.requests-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.requests-modal[hidden] {
  display: none !important;
}

.requests-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.requests-modal-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 1.25rem;
}

.requests-modal-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  border: none;
  background: var(--bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 1;
}

.requests-modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.requests-modal-head {
  margin-bottom: 1rem;
  padding-left: 2.5rem;
}

.requests-modal-head h2 {
  font-size: 1.15rem;
}

.requests-modal-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.requests-modal .sr-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.requests-modal .sr-card h2,
.requests-modal .sr-lead {
  display: none;
}

.requests-modal .sr-nav .btn {
  width: 100%;
}

@media (max-width: 768px) {
  .page-requests .sr-field input,
  .page-requests .sr-field textarea,
  .page-requests .sr-field select,
  .page-requests .sr-field .sr-input {
    font-size: 16px;
  }

  .page-requests .sr-grid {
    grid-template-columns: 1fr;
  }

  .page-requests .sr-back,
  .page-requests .sr-head h1 {
    display: none;
  }

  .page-requests .sr-page {
    padding-bottom: calc(4.75rem + var(--safe-bottom));
  }

  .page-requests .sr-nav {
    display: none;
  }

  .page-requests .sr-sticky-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 290;
    padding: 0.65rem 1rem calc(0.65rem + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--sr-line);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .page-requests .sr-sticky-nav .btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }

  .page-requests .sr-tab {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }

  .sr-form textarea,
  .sr-form .sr-input {
    font-size: 16px;
  }

  .requests-modal {
    display: none !important;
  }
}
