/* ============================================================
   AUTH.CSS - Styles for /auth, /dashboard, and /admin pages
   ============================================================ */

/* ── Auth page layout ── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 3rem;
  background: var(--color-bg-slate);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: 2.75rem 2.5rem 2.5rem;
}

.auth-card__logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card__logo-img {
  height: 36px;
  width: auto;
  filter: invert(1) sepia(1) saturate(0.6) hue-rotate(170deg) brightness(0.25);
}

.auth-card__title {
  font-family: var(--font-subheading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-card__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* ── Tabs ── */

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

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

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

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

/* ── Panels ── */

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

/* ── Form elements ── */

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

.auth-form .form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.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.8rem;
  color: #16a34a;
  margin-bottom: 1rem;
  min-height: 1.2em;
  line-height: 1.4;
}

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

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

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  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);
}


/* ── Gate tab/switch additions in property.css ── */

.prop-gate__tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.prop-gate__tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.625rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.18s, border-color 0.18s;
}

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

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

.prop-gate__success {
  font-size: 0.8rem;
  color: #16a34a;
  margin-bottom: 1rem;
  min-height: 1.2em;
  line-height: 1.4;
}

.prop-gate__alt {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

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

.prop-gate__switch:hover {
  color: var(--color-accent);
}

.prop-gate__link {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-decoration: underline;
}


/* ── Favourite button on property page ── */

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

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

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

.prop-fav-btn.is-saved {
  background: rgba(202, 164, 93, 0.18);
  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
   ================================================================ */

.dash-page {
  min-height: 100vh;
  background: var(--color-bg-slate);
  padding-bottom: 4rem;
}

.dash-header {
  background: var(--color-primary);
  padding: 5.5rem 0 2rem;
}

.dash-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dash-header__greeting {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.dash-header__name {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.1;
}

.dash-header__email {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.35rem;
}

.dash-header__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Dash tabs ── */

.dash-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-white);
  padding: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.dash-tab {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  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;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.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;
}

/* ── Dash panels ── */

.dash-panel {
  padding: 2.5rem 0;
}

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

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

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

/* ── 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;
}

/* ── Favourite cards 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 {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--color-bg-slate);
}

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

.dash-fav-card__price {
  font-family: var(--font-body);
  font-size: 1.1rem;
  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.75rem;
  line-height: 1.4;
}

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

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

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

/* ── Showing requests list ── */

.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.375rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

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

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

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

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

.dash-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  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;
}

/* ── 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.5rem;
}

.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-text-muted);
  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;
  margin-top: -0.25rem;
}

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

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

.modal__form .form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

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

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

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

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

/* ── Profile panel ── */

.dash-profile-form {
  max-width: 480px;
  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; }

.dash-profile-form .form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.dash-profile-save {
  margin-top: 0.5rem;
}


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

.admin-page {
  min-height: 100vh;
  background: var(--color-bg-slate);
  padding-bottom: 4rem;
}

.admin-header {
  background: var(--color-primary);
  padding: 5.5rem 0 2rem;
}

.admin-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.admin-header__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.admin-header__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.1;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Admin stats ── */

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

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

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

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

/* ── Admin tabs ── */

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-white);
  padding: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.admin-tab {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  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;
}

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

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

/* ── Admin panels ── */

.admin-panel { padding: 2rem 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.125rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  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.125rem;
  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.025);
}

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

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

.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.6rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 39, 73, 0.08);
  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-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 0.5rem;
  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.75rem 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);
}


/* ── Responsive ── */

@media (max-width: 900px) {
  .auth-card { padding: 2.25rem 1.75rem; }

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

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

@media (max-width: 640px) {
  .auth-card { padding: 2rem 1.25rem; }

  .dash-header__inner,
  .admin-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .dash-favs-grid {
    grid-template-columns: 1fr;
  }

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

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

  .modal { padding: 1.75rem 1.25rem; }
}
