/* ============================================================
   CUSTOMER ACCOUNT PAGES (my_account.php, edit_account.php) + their modals.
   Mirrors the landing / booking design: Poppins, ink #29252a, hairline #e5e1e2
   borders, #ebadb8 accent, 6-8px radii, flat surfaces, Georgia headings.
   Everything is scoped to .tm-account / .tm-account-modal so no other page changes.
   ============================================================ */
.tm-account,
.tm-account-modal {
  --tm-primary: #ebadb8;
  --tm-ink: #29252a;
  --tm-muted: #625e65;
  --tm-border: #e5e1e2;
  --tm-soft: #faf8f7;
  --tm-deep: #82505d;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tm-ink);
}
.tm-account *,
.tm-account *::before,
.tm-account *::after,
.tm-account-modal *,
.tm-account-modal *::before,
.tm-account-modal *::after {
  box-sizing: border-box;
}
.tm-account :is(a, button, input, select, textarea):focus-visible,
.tm-account-modal :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--tm-deep);
  outline-offset: 3px;
}

/* ---------- Page shell ---------- */
.tm-account {
  background: #fff;
  padding: 56px 0 72px;
}
.tm-account .tm-account-container {
  max-width: 1184px;
  margin: 0 auto;
  padding: 0 24px;
}
.tm-account .tm-account-container.is-narrow {
  max-width: 880px;
}
.tm-account .tm-account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.tm-account .tm-account-head h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--tm-ink);
}
.tm-account .tm-account-head p {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--tm-muted);
}

/* ---------- Buttons ---------- */
.tm-account .tm-btn,
.tm-account .btn-manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--tm-border);
  border-radius: 6px;
  background: #fff;
  color: var(--tm-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tm-account .tm-btn:hover,
.tm-account .btn-manage:hover {
  background: var(--tm-soft);
  border-color: #cdbac1;
  color: var(--tm-ink);
  transform: none;
  box-shadow: none;
}
.tm-account .tm-btn-primary {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
}
.tm-account .tm-btn-primary:hover {
  background: #e49fac;
  border-color: #e49fac;
}
.tm-account .tm-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* ---------- Cards ---------- */
.tm-account .tm-card,
.tm-account .reservation-card {
  background: #fff;
  border: 1px solid var(--tm-border) !important;
  border-top: 3px solid var(--tm-primary) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  overflow: hidden;
}
.tm-account .reservation-card:hover {
  box-shadow: none !important;
}

/* ============================================================
   MY ACCOUNT / RESERVATIONS
   ============================================================ */
.tm-account .reservation-card .card-body {
  padding: 8px 24px 24px !important;
}
.tm-account .modern-table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  font-size: 14px;
}
.tm-account .modern-table thead th {
  background: var(--tm-soft);
  color: var(--tm-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--tm-border);
  padding: 14px 16px;
}
.tm-account .modern-table tbody td {
  color: var(--tm-ink);
  border-bottom: 1px solid var(--tm-border);
  vertical-align: middle;
}
.tm-account .modern-table tbody tr:hover {
  background: var(--tm-soft);
}
.tm-account .modern-table .text-muted,
.tm-account .text-muted {
  color: var(--tm-muted) !important;
}
.tm-account .bg-primary-soft {
  background: var(--tm-soft) !important;
}
.tm-account .action-btn {
  border-radius: 6px;
  border: 1px solid var(--tm-border);
  background: #fff;
  color: var(--tm-ink);
  box-shadow: none;
}
.tm-account .action-btn:hover {
  background: var(--tm-soft);
  border-color: #cdbac1;
  color: var(--tm-ink);
}
.tm-account .status-badge {
  border-radius: 6px;
  box-shadow: none;
}
.tm-account .empty-table-state .btn-primary {
  background: var(--tm-primary) !important;
  border: 1px solid var(--tm-primary) !important;
  border-radius: 6px !important;
  color: var(--tm-ink);
  font-weight: 500;
}
.tm-account .dataTables_wrapper .dataTables_filter input,
.tm-account .dataTables_wrapper .dataTables_length select {
  min-height: 40px;
  border: 1px solid var(--tm-border);
  border-radius: 6px;
  background: #fff;
  color: var(--tm-ink);
  font-family: inherit;
}
.tm-account .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
}
.tm-account .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.tm-account .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--tm-primary) !important;
  border-color: var(--tm-primary) !important;
  color: var(--tm-ink) !important;
}

/* ============================================================
   EDIT ACCOUNT FORM
   ============================================================ */
.tm-account .tm-form {
  margin: 0;
  padding: 0;
}
.tm-account .tm-fieldset {
  border: 0;
  margin: 0;
  padding: 32px;
  min-width: 0;
}
.tm-account .tm-fieldset + .tm-fieldset {
  border-top: 1px solid var(--tm-border);
}
.tm-account .tm-fieldset > legend {
  float: none;
  width: auto;
  padding: 0;
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--tm-ink);
}
.tm-account .tm-fieldset-note {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--tm-muted);
}
.tm-account .tm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.tm-account .tm-field {
  min-width: 0;
}
.tm-account .tm-field.is-wide {
  grid-column: 1 / -1;
}
.tm-account .tm-field label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tm-ink);
}
.tm-account .tm-optional {
  font-weight: 400;
  color: var(--tm-muted);
}
.tm-account .tm-input {
  position: relative;
}
.tm-account .tm-control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #cfc8cb;
  border-radius: 6px;
  background: #fff;
  color: var(--tm-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
.tm-account select.tm-control {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2329252a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.tm-account textarea.tm-control {
  min-height: 96px;
  resize: vertical;
}
.tm-account .tm-control::placeholder {
  color: #8a858c;
  opacity: 1;
}
.tm-account .tm-control:hover {
  border-color: #a9a1a5;
}
.tm-account .tm-control:focus {
  border-color: var(--tm-deep);
  outline: 2px solid var(--tm-primary);
  outline-offset: 1px;
}
.tm-account .tm-control:user-invalid {
  border-color: #b4414f;
}
.tm-account .tm-control.tm-password {
  padding-right: 52px;
}
.tm-account .tm-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tm-muted);
  cursor: pointer;
}
.tm-account .tm-toggle:hover {
  background: var(--tm-soft);
  color: var(--tm-deep);
}
.tm-account .tm-help {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tm-muted);
}
.tm-account .tm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 32px;
  border-top: 1px solid var(--tm-border);
  background: var(--tm-soft);
}
.tm-account .tm-message {
  margin: 0 32px;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}
.tm-account .tm-message:not([hidden]) {
  display: block !important;
  margin-top: 32px;
}
.tm-account .tm-message[hidden] {
  display: none !important;
}
.tm-account .tm-message.is-error {
  border: 1px solid #e3b6bc;
  background: #fdf3f4;
  color: #8f2a37;
}
.tm-account .tm-message.is-success {
  border: 1px solid #b9d6c5;
  background: #f1f8f4;
  color: #245f40;
}

/* ============================================================
   MODALS (both account pages)
   ============================================================ */
.tm-account-modal .modal-dialog {
  max-width: min(500px, calc(100vw - 24px));
  margin-left: auto;
  margin-right: auto;
}
.tm-account-modal .modal-dialog.modal-lg {
  max-width: min(800px, calc(100vw - 24px));
}
.tm-account-modal .modal-content {
  border: 1px solid var(--tm-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(41, 37, 42, 0.16);
  overflow: hidden;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}
.tm-account-modal .modal-header {
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid var(--tm-border);
}
.tm-account-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--tm-ink);
  overflow-wrap: anywhere;
}
.tm-account-modal .modal-title i {
  color: var(--tm-deep);
  font-size: 16px;
}
.tm-account-modal .modal-header .close,
.tm-account-modal .modal-header .btn-close {
  min-width: 44px;
  min-height: 44px;
  margin: -8px -12px -8px auto;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  color: var(--tm-muted);
  opacity: 1;
  text-shadow: none;
}
.tm-account-modal .modal-header .close:hover,
.tm-account-modal .modal-header .btn-close:hover {
  background-color: var(--tm-soft);
  color: var(--tm-ink);
}
.tm-account-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  color: var(--tm-ink);
  font-size: 14px;
  line-height: 1.7;
}
.tm-account-modal .modal-body img,
.tm-account-modal .modal-body iframe,
.tm-account-modal .modal-body video {
  max-width: 100%;
  height: auto;
}
.tm-account-modal .modal-body table {
  max-width: 100%;
}
.tm-account-modal .modal-footer {
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: var(--tm-soft);
  border-top: 1px solid var(--tm-border);
}
.tm-account-modal .modal-footer > * {
  margin: 0;
}
.tm-account-modal .modal-btn,
.tm-account-modal .modal-footer .btn {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--tm-border);
  border-radius: 6px;
  background: #fff;
  color: var(--tm-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}
.tm-account-modal .modal-btn:hover,
.tm-account-modal .modal-footer .btn:hover {
  background: var(--tm-soft);
  border-color: #cdbac1;
  color: var(--tm-ink);
}
.tm-account-modal :is(.modal-btn-primary, .modal-btn-success, .modal-btn-info, .modal-btn-gcash) {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
  color: var(--tm-ink);
}
.tm-account-modal :is(.modal-btn-primary, .modal-btn-success, .modal-btn-info, .modal-btn-gcash):hover {
  background: #e49fac;
  border-color: #e49fac;
  color: var(--tm-ink);
}
.tm-account-modal .modal-btn-danger {
  background: #fff;
  border-color: #b4414f;
  color: #8f2a37;
}
.tm-account-modal .modal-btn-danger:hover {
  background: #fdf3f4;
  border-color: #8f2a37;
  color: #8f2a37;
}
.tm-account-modal .modal-btn:disabled,
.tm-account-modal .modal-footer .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tm-account-modal :is(.form-control, .form-select, .gcash-input, .cancellation-reason-input, input[type="text"], input[type="tel"], input[type="email"], input[type="number"], textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  max-width: 100%;
  border: 1px solid #cfc8cb;
  border-radius: 6px;
  background-color: #fff;
  color: var(--tm-ink);
  font-family: inherit;
  font-size: 15px;
  box-shadow: none;
}
.tm-account-modal :is(.form-control, .form-select, .gcash-input, .cancellation-reason-input, textarea, select):focus {
  border-color: var(--tm-deep);
  outline: 2px solid var(--tm-primary);
  outline-offset: 1px;
  box-shadow: none;
}
.tm-account-modal :is(.gcash-input.error, .is-invalid) {
  border-color: #b4414f;
}
.tm-account-modal .info-box,
.tm-account-modal .warning-list {
  border: 1px solid var(--tm-border);
  border-radius: 6px;
  background: var(--tm-soft);
  box-shadow: none;
}
.tm-account-modal .info-row {
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .tm-account {
    padding: 48px 0 56px;
  }
  .tm-account .tm-account-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
}
@media (max-width: 600px) {
  .tm-account {
    padding: 40px 0 48px;
  }
  .tm-account .tm-account-container {
    padding: 0 20px;
  }
  .tm-account .tm-account-head h1 {
    font-size: 30px;
  }
  .tm-account .tm-account-head .btn-manage,
  .tm-account .tm-account-head .tm-btn {
    width: 100%;
  }
  .tm-account .reservation-card .card-body {
    padding: 4px 12px 16px !important;
  }
  .tm-account .tm-fieldset {
    padding: 24px 20px;
  }
  .tm-account .tm-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .tm-account .tm-message {
    margin: 0 20px;
  }
  .tm-account .tm-message:not([hidden]) {
    margin-top: 24px;
  }
  .tm-account .tm-actions {
    padding: 20px;
  }
  .tm-account .tm-actions .tm-btn {
    width: 100%;
  }
  .tm-account .tm-control {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
  .tm-account-modal .modal-dialog {
    margin: 12px auto;
  }
  .tm-account-modal .modal-header,
  .tm-account-modal .modal-body,
  .tm-account-modal .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .tm-account-modal .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .tm-account-modal .modal-footer .modal-btn,
  .tm-account-modal .modal-footer .btn {
    width: 100%;
  }
  .tm-account-modal :is(.form-control, .form-select, .gcash-input, .cancellation-reason-input, textarea, select) {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tm-account *,
  .tm-account-modal * {
    transition: none !important;
  }
}
