/* ============================================================
   AUTH.CSS - /auth, /dashboard, /admin pages
   Builds on top of main.css + components.css + inner.css
   ============================================================ */

/* ── Auth page two-column left panel ── */

.auth-benefits {
  padding-right: 1.5rem;
}

.auth-benefits__title {
  font-family: var(--font-subheading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.auth-benefit-item {
  display: flex;
  gap: 1.125rem;
  align-items: flex-start;
  margin-bottom: 1.625rem;
}

.auth-benefit-item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 39, 73, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.auth-benefit-item__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.auth-benefit-item__text {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Auth form card tabs ── */

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin: -2rem -2rem 2rem;
  padding: 0 2rem;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 1rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.18s, border-color 0.18s;
  text-align: center;
}

.auth-tab:hover {
  color: var(--color-primary);
}

.auth-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.auth-panel--hidden {
  display: none;
}

@keyframes auth-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-panel--entering {
  animation: auth-panel-in 0.22s ease both;
}

.form-input--error {
  border-color: #dc2626 !important;
  background-color: rgba(220, 38, 38, 0.03) !important;
}

/* ── Form elements (use existing form-label--dark + form-input--light) ── */

.auth-form .form-group {
  margin-bottom: 1.125rem;
}

.auth-required {
  color: var(--color-accent);
}

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

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .form-input {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  padding: 0.25rem;
  transition: color 0.18s;
}

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

.auth-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-bottom: 1rem;
  min-height: 1.2em;
  line-height: 1.4;
}

.auth-success {
  font-size: 0.875rem;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.07);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.auth-success:empty {
  display: none;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.auth-switch__btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.auth-switch__btn:hover {
  color: var(--color-accent);
}

/* ── Forgot password link ── */
.auth-forgot {
  text-align: right;
  margin-top: -0.375rem;
  margin-bottom: 0.875rem;
}

.auth-forgot .auth-switch__btn {
  font-size: 0.8rem;
  font-weight: 600;
}


/* ── Gate overlay: card title, description, and tab state ── */

.prop-gate__title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.375rem;
}

.prop-gate__desc {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.prop-gate__panel--hidden {
  display: none;
}

.prop-gate__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}


/* ── Favourite button on property hero ── */

.prop-fav-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.prop-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.prop-fav-btn:hover {
  background: rgba(202, 164, 93, 0.18);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.prop-fav-btn.is-saved {
  background: rgba(202, 164, 93, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.prop-fav-btn svg {
  flex-shrink: 0;
  transition: fill 0.18s, stroke 0.18s;
}

.prop-fav-btn.is-saved svg {
  fill: var(--color-accent);
  stroke: var(--color-accent);
}


/* ================================================================
   DASHBOARD PAGE — uses page-hero + section pattern
   ================================================================ */

/* User's name appears inside page-hero__title via JS */

.dash-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* ── Dashboard tabs bar ── */

.dash-tabs-section {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-tabs {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1.125rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.18s, border-color 0.18s;
  letter-spacing: 0.01em;
}

.dash-tab:hover { color: var(--color-primary); }

.dash-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.dash-tab__badge {
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  min-width: 1.25rem;
  text-align: center;
}

/* ── Panels ── */

.dash-panel { padding: 3rem 0; }
.dash-panel--hidden { display: none; }

.dash-panel__head {
  margin-bottom: 2rem;
}

.dash-panel__title {
  font-family: var(--font-subheading);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.dash-panel__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ── Empty state ── */

.dash-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.dash-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: rgba(10, 39, 73, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.dash-empty__title {
  font-family: var(--font-subheading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.dash-empty__text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 1.5rem;
}

/* ── Favourites grid ── */

.dash-favs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.dash-fav-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.dash-fav-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-fav-card__img-wrap {
  display: block;
  aspect-ratio: 4/3;
  background: var(--color-bg-slate);
  overflow: hidden;
}

.dash-fav-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.dash-fav-card:hover .dash-fav-card__img {
  transform: scale(1.03);
}

.dash-fav-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dash-fav-card__body {
  padding: 1.125rem 1.25rem 1.25rem;
}

.dash-fav-card__price {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.dash-fav-card__address {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.625rem;
  line-height: 1.4;
}

.dash-fav-card__specs {
  display: flex;
  gap: 0.875rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.dash-fav-card__actions {
  display: flex;
  gap: 0.625rem;
}

.dash-fav-card__actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.775rem;
  padding: 0.5rem 0.625rem;
}

.dash-remove-btn {
  display: block;
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  margin-top: 0.625rem;
  text-decoration: underline;
  padding: 0;
  font-family: var(--font-body);
  transition: color 0.18s;
}

.dash-remove-btn:hover {
  color: #dc2626;
}

/* ── Showing requests ── */

.dash-requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-request-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.dash-request-card__info {
  flex: 1;
  min-width: 200px;
}

.dash-request-card__address {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.dash-request-card__meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.dash-request-card__message {
  font-size: 0.82rem;
  color: var(--color-text);
  margin-top: 0.5rem;
  font-style: italic;
  line-height: 1.5;
}

.dash-status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.dash-status-badge--pending  { background: rgba(234, 179, 8, 0.12); color: #92400e; }
.dash-status-badge--confirmed { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.dash-status-badge--declined  { background: rgba(220, 38, 38, 0.1);  color: #991b1b; }

/* ── Profile panel ── */

.dash-profile-form {
  max-width: 520px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.dash-profile-form .form-group {
  margin-bottom: 1.25rem;
}


/* ── Request showing modal ── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(10, 15, 26, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem 2rem;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  font-family: var(--font-subheading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
}

.modal__subtitle {
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: 0.25rem;
}

.modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-bg-slate);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.18s, color 0.18s;
  margin-top: -0.25rem;
}

.modal__close:hover {
  background: var(--color-border);
  color: var(--color-primary);
}

.modal__form .form-group { margin-bottom: 1.125rem; }

.modal__error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-bottom: 1rem;
  min-height: 1.2em;
}

.modal__success {
  font-size: 0.875rem;
  color: #16a34a;
  text-align: center;
  padding: 1rem;
  background: rgba(22, 163, 74, 0.07);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.modal__actions .btn { flex: 1; justify-content: center; }


/* ================================================================
   ADMIN PAGE
   ================================================================ */

.admin-stats-section {
  padding: 2.5rem 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 0;
}

.admin-stat {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.admin-stat__number {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.admin-stat__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ── Admin tabs ── */

.admin-tabs-section {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  margin-top: 2.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-tabs {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1.125rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
  letter-spacing: 0.01em;
}

.admin-tab:hover { color: var(--color-primary); }

.admin-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.admin-panel { padding: 2.5rem 0; }
.admin-panel--hidden { display: none; }

/* ── Data tables ── */

.admin-table-wrap {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: 0.875rem 1.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-bg-slate);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover td {
  background: rgba(10, 39, 73, 0.022);
}

.admin-table__name {
  font-weight: 700;
  color: var(--color-primary);
}

.admin-table__email {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.admin-status-select {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
}

.admin-role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 39, 73, 0.07);
  color: var(--color-primary);
}

.admin-role-badge--admin {
  background: rgba(202, 164, 93, 0.15);
  color: #78410a;
}

/* ── User detail drawer ── */

.admin-detail-drawer {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.75rem;
  margin-top: -1px;
  display: none;
}

.admin-detail-drawer--open { display: block; }

.admin-detail-drawer__title {
  font-family: var(--font-subheading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.admin-drawer-favs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.admin-drawer-fav {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.82rem;
}

.admin-drawer-fav__address {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

.admin-drawer-fav__price {
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
}


/* ── Responsive ── */

@media (max-width: 900px) {
  .auth-tabs {
    margin: -1.75rem -1.5rem 1.75rem;
    padding: 0 1.5rem;
  }

  .dash-favs-grid { grid-template-columns: repeat(2, 1fr); }

  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .dash-favs-grid { grid-template-columns: 1fr; }

  .dash-request-card { flex-direction: column; }

  .modal { padding: 1.75rem 1.25rem; }

  .admin-stats { grid-template-columns: repeat(2, 1fr); }

  .dash-tabs,
  .admin-tabs { padding: 0 1rem; }
}
