/* ==========================================================================
   CDEscapes — modals.css
   Login, stay detail and toast notifications.
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(20, 18, 15, 0.64);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-close {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-silver);
  border-radius: 50%;
  background: rgba(252, 250, 247, 0.9);
  color: var(--charcoal);
  transition: all var(--transition-fast);
}

.modal-close svg {
  width: 1rem;
  height: 1rem;
}

.modal-close:hover {
  background: var(--white);
  border-color: var(--silver-600);
  color: var(--black);
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  width: min(1000px, 100%);
  max-height: calc(100vh - 4rem);
  max-height: calc(100svh - 4rem);
  overflow: hidden;
  border: 1px solid rgba(215, 224, 232, 0.35);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.36);
  transform: translateY(18px) scale(0.99);
  transition: transform 0.35s var(--ease);
}

.modal-backdrop.open .login-panel {
  transform: translateY(0) scale(1);
}

.login-panel.is-shaking {
  animation: shake 0.4s ease;
}

.login-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: #1d1a16;
}

.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.9) 0%, rgba(20, 18, 15, 0.15) 55%, rgba(20, 18, 15, 0.35) 100%);
}

.login-visual-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 2.5rem;
}

.login-visual-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(252, 250, 247, 0.35);
  border-radius: var(--radius-sm);
  color: var(--silver-bright);
}

.login-visual-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.login-quote {
  max-width: 300px;
  margin-bottom: 1.2rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  color: var(--cream);
}

.login-visual-copy .caption {
  color: rgba(238, 242, 247, 0.7);
}

.login-form-wrap {
  overflow-y: auto;
  padding: 3rem 3.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--silver-300) transparent;
}

.login-form-wrap .caption {
  margin-bottom: 0.6rem;
}

.login-form-wrap .h3 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.login-intro {
  margin-bottom: 1.8rem;
}

.login-form .field {
  margin-bottom: 1.1rem;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--silver-600);
  transition: color var(--transition-fast);
}

.password-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

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

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0 1.2rem;
}

.checkbox-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.76rem;
  color: var(--warm-grey);
  cursor: pointer;
  user-select: none;
}

.login-form .btn-block {
  height: 3.05rem;
}

.button-spinner {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(35, 48, 61, 0.25);
  border-top-color: #23303d;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

#login-submit[aria-busy="true"] .button-spinner {
  display: inline-block;
}

#login-submit[aria-busy="true"] > svg {
  display: none;
}

.demo-box {
  margin-top: 1.6rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border-silver-strong);
  border-radius: var(--radius-sm);
  background: rgba(247, 243, 237, 0.66);
}

.demo-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.demo-box-head .btn-text {
  font-size: 0.64rem;
}

.demo-credentials {
  font-size: 0.79rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--charcoal);
}

.demo-credentials span {
  color: var(--silver-500);
}

.demo-note {
  margin-top: 0.3rem;
  font-size: 0.64rem;
  line-height: 1.5;
  color: var(--muted);
}

.login-foot {
  margin-top: 1.4rem;
  font-size: 0.76rem;
  color: var(--warm-grey);
}

.login-foot a {
  color: var(--silver-ink);
  font-weight: 500;
  text-underline-offset: 3px;
}

.login-switch {
  padding: 0;
  border: 0;
  background: none;
  color: var(--silver-ink);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.login-switch:hover {
  color: var(--charcoal);
}

.field-hint {
  margin-top: 0.45rem;
  font-size: 0.66rem;
  line-height: 1.5;
  color: var(--muted);
}

#register-note {
  margin-top: 0.8rem;
}

/* --------------------------------------------------------------------------
   Stay detail
   -------------------------------------------------------------------------- */

.stay-modal-panel {
  position: relative;
  width: min(940px, 100%);
  max-height: calc(100vh - 4rem);
  max-height: calc(100svh - 4rem);
  overflow-y: auto;
  border: 1px solid rgba(215, 224, 232, 0.35);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.36);
  transform: translateY(18px) scale(0.99);
  transition: transform 0.35s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: var(--silver-300) transparent;
}

.modal-backdrop.open .stay-modal-panel {
  transform: translateY(0) scale(1);
}

.stay-detail-media {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--silver-200), var(--cream-warm));
}

.stay-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stay-detail-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.28), transparent 55%);
  pointer-events: none;
}

.stay-detail-media .stay-badge {
  top: 1rem;
  right: auto;
  left: 1rem;
}

.stay-detail-body {
  padding: 2.2rem 2.6rem 2.4rem;
}

.stay-detail-body .h3 {
  margin: 0.2rem 0 0.55rem;
}

.stay-detail-copy {
  max-width: 700px;
  margin: 1rem 0 1.6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--charcoal);
}

.stay-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.detail-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--silver-ink);
}

.stay-detail-grid p {
  font-size: 0.8rem;
  color: var(--charcoal);
}

.stay-detail-amenities {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--border-light);
}

.stay-detail-amenities ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem 1rem;
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
}

.stay-detail-amenities li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--warm-grey);
}

.stay-detail-amenities li svg {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
  color: var(--silver-600);
}

.stay-detail-rate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.4rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border-silver);
  border-radius: var(--radius);
  background: rgba(247, 243, 237, 0.66);
}

.stay-detail-price {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--black);
}

.stay-detail-price span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
}

.stay-detail-was {
  font-size: 0.7rem;
  color: var(--muted);
}

.stay-detail-dates {
  margin-top: 1.1rem;
  font-size: 0.76rem;
  color: var(--warm-grey);
}

.stay-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.stay-detail-note {
  margin-top: 1.1rem;
  font-size: 0.66rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Booking
   -------------------------------------------------------------------------- */

.booking-panel {
  width: min(820px, 100%);
}

.booking-body {
  padding: 2.6rem 2.8rem 2.4rem;
}

.booking-body .h3 {
  margin: 0.2rem 0 0.55rem;
}

.booking-intro {
  max-width: 620px;
  margin-bottom: 1.6rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--warm-grey);
}

.booking-summary {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border-silver);
  border-radius: var(--radius);
  background: rgba(247, 243, 237, 0.66);
}

.booking-summary-media {
  height: 100px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--silver-200), var(--cream-warm));
}

.booking-summary-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.booking-stay-name {
  margin: 0.1rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--black);
}

.booking-summary-meta,
.booking-summary-room {
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--warm-grey);
}

.booking-summary-price {
  text-align: right;
  white-space: nowrap;
}

.booking-total {
  margin: 0.15rem 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--black);
}

.booking-summary-rate {
  font-size: 0.66rem;
  color: var(--muted);
}

.booking-form {
  margin-top: 1.6rem;
}

.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.booking-form .field {
  margin-bottom: 1rem;
}

.booking-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  color: var(--charcoal);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.6;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.booking-form textarea:hover {
  border-color: var(--border-silver-strong);
}

.booking-form textarea:focus {
  outline: none;
  border-color: var(--silver-600);
  box-shadow: 0 0 0 3px rgba(190, 204, 218, 0.24);
}

.booking-form textarea::placeholder {
  color: var(--muted);
}

.booking-form input[readonly] {
  background: rgba(243, 239, 233, 0.8);
  color: var(--warm-grey);
  cursor: not-allowed;
}

.field-optional {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.booking-terms {
  align-items: flex-start;
  margin: 0.4rem 0 1.2rem;
  line-height: 1.55;
}

.booking-terms .filter-box {
  margin-top: 0.15rem;
}

.booking-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: var(--silver-gradient-strong);
  color: #26303a;
}

.booking-check svg {
  width: 1.3rem;
  height: 1.3rem;
}

.booking-reference {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin: 1.3rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-silver);
  border-radius: var(--radius-sm);
  background: rgba(247, 243, 237, 0.66);
}

.booking-reference strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--black);
}

@media (max-width: 720px) {
  .booking-panel {
    width: 100%;
  }

  .booking-body {
    padding: 2rem 1.4rem;
  }

  .booking-summary {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 1rem;
  }

  .booking-summary-copy {
    min-width: 0;
  }

  .booking-summary-media {
    height: 72px;
  }

  .booking-summary-price {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
    white-space: normal;
  }

  .booking-summary-rate {
    display: block;
    white-space: normal;
  }

  .booking-total {
    font-size: 1.25rem;
  }

  .booking-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(440px, calc(100vw - 2rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(190, 204, 218, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(26, 24, 21, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--cream);
  font-size: 0.78rem;
  line-height: 1.5;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--silver-gradient-strong);
  color: #26303a;
}

.toast-icon svg {
  width: 0.8rem;
  height: 0.8rem;
}

.toast--error .toast-icon {
  background: linear-gradient(135deg, #d7b4b4, #b98a8a);
}
