/* ============================================================
   UOB component patterns — branch appointment booking
   ============================================================ */
/* ── BUTTON ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-primary-bold);
  font-weight: var(--uob-fw-bold);
  border: 1px solid transparent;
  border-radius: var(--uob-radius-sm);
  cursor: pointer;
  transition:
    background var(--uob-motion-fast),
    border-color var(--uob-motion-fast),
    color var(--uob-motion-fast),
    box-shadow var(--uob-motion-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--uob-hover-blue);
  color: var(--uob-white);
}
.btn-primary:hover:not(:disabled) {
  background: var(--uob-primary);
}
.btn-primary:active:not(:disabled) {
  background: var(--uob-accent-blue);
}
.btn-primary:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--uob-grey-20);
  color: var(--uob-black);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--uob-grey-30);
}
.btn-secondary:active:not(:disabled) {
  background: var(--uob-grey-40);
  color: var(--uob-white);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  color: var(--uob-primary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--uob-primary-dark);
  background: var(--uob-grey-10);
}
.btn-ghost:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  color: var(--uob-primary);
  border-color: var(--uob-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--uob-blue-soft);
}
.btn-outline:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: var(--uob-font-xs);
}
.btn-md {
  height: 40px;
  padding: 0 18px;
  font-size: var(--uob-font-sm);
}
.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: var(--uob-font-base);
}

.btn:disabled,
.btn.is-disabled {
  background: var(--uob-grey-20);
  color: var(--uob-grey-30);
  border-color: transparent;
  cursor: not-allowed;
}

.btn-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── RADIO PILL GROUP (used for Personal / Business filter) ── */
.pill-group {
  display: inline-flex;
  background: var(--uob-grey-10);
  border-radius: var(--uob-radius-full);
  padding: 4px;
  gap: 4px;
}
.pill-group__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--uob-grey-40);
  font-weight: var(--uob-fw-bold);
  font-size: var(--uob-font-sm);
  padding: 8px 18px;
  border-radius: var(--uob-radius-full);
  cursor: pointer;
  transition:
    background var(--uob-motion-fast),
    color var(--uob-motion-fast);
}
.pill-group__btn[aria-pressed='true'] {
  background: var(--uob-white);
  color: var(--uob-primary);
  box-shadow: var(--uob-shadow-1);
}
.pill-group__btn:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

/* ── CHECKBOX (for service basket additions) ── */
.cb {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--uob-grey-30);
  border-radius: var(--uob-radius-sm);
  background: var(--uob-white);
  cursor: pointer;
  position: relative;
  transition:
    border-color var(--uob-motion-fast),
    background var(--uob-motion-fast);
}
.cb:hover {
  border-color: var(--uob-black);
}
.cb:focus {
  outline: none;
  border-color: var(--uob-accent-blue);
}
.cb:checked {
  background: var(--uob-accent-blue);
  border-color: var(--uob-accent-blue);
}
.cb:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: 2px solid var(--uob-white);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.cb:disabled {
  background: var(--uob-grey-10);
  border-color: var(--uob-grey-20);
  cursor: not-allowed;
}

/* ── TEXT INPUT ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.field__label {
  font-size: var(--uob-font-sm);
  font-weight: var(--uob-fw-bold);
  color: var(--uob-black);
}
.field__row {
  position: relative;
  display: flex;
  align-items: center;
}
.field__input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 14px;
  font-size: var(--uob-font-base);
  color: var(--uob-black);
  background: var(--uob-white);
  border: 1px solid var(--uob-grey-30);
  border-radius: var(--uob-radius-md);
  outline: none;
  transition:
    border-color var(--uob-motion-fast),
    box-shadow var(--uob-motion-fast);
}
.field__input::placeholder {
  color: var(--uob-grey-30);
}
.field__input:hover {
  border-color: var(--uob-black);
}
.field__input:focus {
  border-color: var(--uob-primary);
  box-shadow: 0 0 0 3px var(--rsvp-focus-ring);
}
.field__icon {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
  color: var(--uob-grey-40);
  pointer-events: none;
}
.field__helper {
  font-size: var(--uob-font-xs);
  color: var(--uob-grey-40);
}
.field__helper.is-error {
  color: var(--uob-red);
}

/* ── CARD ── */
.card {
  background: var(--uob-white);
  border: 1px solid var(--uob-border);
  border-radius: var(--uob-radius-lg);
  padding: var(--rsvp-card-pad);
}
.card--soft {
  background: var(--uob-blue-soft);
  border-color: var(--rsvp-focus-ring);
}

/* ── BADGE / TAG ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--uob-font-xs);
  font-weight: var(--uob-fw-bold);
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--uob-radius-full);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.tag--neutral {
  background: var(--uob-grey-10);
  color: var(--uob-grey-40);
}
.tag--info {
  background: var(--uob-blue-soft);
  color: var(--uob-primary);
}
.tag--warn {
  background: var(--uob-amber-soft);
  color: var(--element-warning-8);
}
/* Outline variant — no fill; muted green border + label, regular weight so it
   reads as a quiet status hint next to a bolder service name. */
.tag--success {
  background: transparent;
  color: var(--uob-green);
  border-color: var(--uob-green);
  font-weight: var(--uob-fw-regular);
  padding: 2px 8px;
  border-radius: 4px;
}
.tag--brand {
  background: var(--uob-primary);
  color: var(--uob-white);
}

/* ── NOTICE (status banner) ── */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--uob-radius-md);
  font-size: var(--uob-font-sm);
  line-height: var(--uob-lh-normal);
  border: 1px solid transparent;
}
.notice__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notice__body {
  flex: 1;
}
.notice__title {
  font-weight: var(--uob-fw-bold);
  display: block;
  margin-bottom: 2px;
}
.notice--info {
  background: var(--uob-blue-soft);
  border-color: var(--rsvp-focus-border);
  color: var(--uob-accent-blue);
}
.notice--warn {
  background: var(--uob-amber-soft);
  border-color: var(--element-warning-2);
  color: var(--element-warning-9);
}
.notice--success {
  background: var(--uob-green-soft);
  border-color: var(--rsvp-success-border);
  color: var(--element-success-8);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--uob-grey-10);
  border: none;
}

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

/* ── QUICK-LINKS GRID (#offload-panel) ──
   Offload quick-link grid with white tiles. Mobile-first single column;
   three equal columns from the 641px breakpoint up. */
.offload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 641px) {
  .offload-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.offload-grid__tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  padding-bottom: 40px; /* reserve space for the bottom-right external link icon */
  min-height: 88px;
  background: var(--uob-white);
  border: 1px solid var(--uob-border);
  border-radius: var(--uob-radius-md);
  text-decoration: none;
  color: var(--uob-primary);
  transition:
    background var(--uob-motion-fast),
    border-color var(--uob-motion-fast),
    box-shadow var(--uob-motion-fast);
}
.offload-grid__tile:hover {
  background: var(--uob-blue-soft);
  border-color: var(--uob-primary);
  box-shadow: var(--uob-shadow-1);
}
.offload-grid__tile:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}
.offload-grid__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.offload-grid__title {
  font-size: var(--uob-font-sm);
  font-weight: var(--uob-fw-bold);
  color: var(--uob-primary);
  line-height: var(--uob-lh-tight);
}
.offload-grid__desc {
  font-size: var(--uob-font-xs);
  color: var(--uob-grey-40);
  line-height: var(--uob-lh-normal);
}
.offload-grid__ext {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  opacity: 0.7;
  pointer-events: none;
}
.offload-grid__tile:hover .offload-grid__ext {
  opacity: 1;
}

/* ── ICON BUTTON ── */
.icon-btn {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--uob-grey-40);
  width: 36px;
  height: 36px;
  border-radius: var(--uob-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--uob-motion-fast),
    color var(--uob-motion-fast);
}
.icon-btn:hover {
  background: var(--uob-grey-10);
  color: var(--uob-black);
}
.icon-btn:focus-visible {
  outline: 3px solid var(--uob-hover-blue);
  outline-offset: 2px;
}

/* ── CONFIRM OVERLAY (#app-confirm-overlay) ──
   In-app replacement for window.confirm. Sits above the service footer
   (z-index 50). Hidden via the [hidden] attribute when inactive. */
#app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--rsvp-page-pad-x);
}
#app-confirm-overlay[hidden] {
  display: none;
}
.app-confirm-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: var(--rsvp-overlay-scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.app-confirm-dialog {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100vh - 2 * var(--rsvp-page-pad-x));
  overflow-y: auto;
  background: var(--uob-white);
  border-radius: var(--uob-radius-lg);
  box-shadow: var(--uob-shadow-3);
  padding: var(--rsvp-card-pad);
}
.app-confirm-dialog__body {
  display: grid;
  gap: 12px;
  color: var(--uob-grey-50);
  font-size: var(--uob-font-sm);
  line-height: var(--uob-lh-normal);
}
.app-confirm-dialog__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 0 40px; /* space on the left and right so they don't span full width */
}
.app-confirm-dialog__actions .btn {
  flex: 1 1 0; /* equal width for both buttons */
  max-width: 160px;
}
.app-confirm-dialog__actions #app-confirm-cancel {
  background: var(--uob-white);
  color: var(--uob-grey-50);
  border-color: var(--uob-grey-30);
}
.app-confirm-dialog__actions #app-confirm-cancel:hover:not(:disabled) {
  background: var(--uob-grey-10);
  color: var(--uob-black);
}
body.has-modal-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .app-confirm-dialog__actions {
    padding: 0 12px;
  }
}
