/* ============================================
   Isabelle Apartments — Elegant Resident Portal
   Soft, refined, Southern-inspired palette
   ============================================ */

:root {
  --cream: #f8f5f0;
  --ivory: #fdfbf7;
  --sage: #7a8f7a;
  --sage-dark: #5c6e5c;
  --sage-light: #e8eee8;
  --charcoal: #2c2c2c;
  --muted: #6b6b6b;
  --border: #e5e0d8;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(44, 44, 44, 0.06);
  --shadow-lg: 0 12px 40px rgba(44, 44, 44, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

p { color: var(--muted); }

a {
  color: var(--sage-dark);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--sage); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--sage-dark);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--sage);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}

.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--sage-light);
  border-color: var(--sage);
}

.btn.full { width: 100%; }

.coming-soon {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--sage-dark);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* Pages */
.page {
  display: none;
  min-height: 100vh;
}
.page.active {
  display: block;
}

/* Header */
.site-header,
.dash-header {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--sage-dark);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
}
.logo-mark.small {
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  margin: 0 auto 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.logo-text span {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  font-size: 0.95rem;
  color: var(--muted);
}
.nav a:hover { color: var(--charcoal); }

/* Hero */
.hero {
  position: relative;
  height: 70vh;
  min-height: 480px;
  background: linear-gradient(135deg, #3d4a3d 0%, #5c6e5c 50%, #7a8f7a 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(248,245,240,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 640px;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 16px;
  color: white;
}

.hero h1 {
  color: white;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  max-width: 420px;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 56px;
}
.section-header p {
  margin-top: 16px;
  font-size: 1.05rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.feature {
  background: var(--white);
  padding: 32px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--sage-light);
  color: var(--sage-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 20px;
}

.feature h3 {
  margin-bottom: 10px;
}

/* Contact */
.contact {
  background: var(--ivory);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.contact-list {
  list-style: none;
  margin-top: 28px;
}
.contact-list li {
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.contact-list strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-card {
  background: var(--white);
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.contact-card h3 {
  margin-bottom: 12px;
}
.contact-card p {
  margin-bottom: 24px;
}

/* Footer */
.site-footer {
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--ivory);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 44, 44, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card.wide {
  max-width: 560px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--charcoal); }

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}
.modal-header h2 {
  margin-bottom: 6px;
}
.modal-header p {
  font-size: 0.95rem;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--charcoal);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--ivory);
  color: var(--charcoal);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(122, 143, 122, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-error {
  color: #b33a3a;
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-align: center;
}

.demo-note {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.demo-note code {
  background: var(--sage-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* Dashboard */
.dash-header .header-inner {
  height: 64px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.95rem;
}

.dash-main {
  padding: 40px 24px 80px;
}

.dash-welcome {
  margin-bottom: 36px;
}
.dash-welcome h1 {
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-header h2 {
  font-size: 1.2rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}
.badge.paid {
  background: var(--sage-light);
  color: var(--sage-dark);
}

.rent-amount {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.rent-amount .currency {
  font-size: 1.4rem;
  color: var(--muted);
}
.rent-amount .period {
  font-size: 1rem;
  color: var(--muted);
  font-family: var(--font-sans);
  margin-left: 4px;
}

.rent-due {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.card-note {
  font-size: 0.8rem;
  margin-top: 14px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.action-btn:hover {
  background: var(--sage-light);
  border-color: var(--sage);
}

.action-icon {
  font-size: 1.2rem;
}

.info-list {
  display: grid;
  gap: 16px;
}
.info-list div {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.info-list div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.info-list dt {
  font-size: 0.85rem;
  color: var(--muted);
}
.info-list dd {
  font-weight: 500;
}

/* Tickets */
.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-item {
  padding: 14px 16px;
  background: var(--ivory);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--sage);
}
.ticket-item.high { border-left-color: #d97706; }
.ticket-item.emergency { border-left-color: #b33a3a; }

.ticket-item h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.ticket-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-status {
  font-weight: 500;
  color: var(--sage-dark);
}

.empty-state {
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--charcoal);
  color: white;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .nav a { display: none; }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .hero {
    height: 60vh;
    min-height: 400px;
  }
}

@media (max-width: 480px) {
  .modal-card {
    padding: 28px 20px;
  }
  .card {
    padding: 22px;
  }
}

/* ========== Auth Tabs ========== */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--sage-light);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.auth-panel {
  display: none;
}
.auth-panel.active {
  display: block;
}

/* ========== Status Badges ========== */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}
.badge-paid {
  background: var(--sage-light);
  color: var(--sage-dark);
}
.badge-due {
  background: #fef3c7;
  color: #92400e;
}
.badge-late {
  background: #fee2e2;
  color: #b91c1c;
}

/* ========== Admin Table ========== */
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.muted {
  color: var(--muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  background: var(--sage-dark);
  color: white;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: background 0.2s;
}
.btn-sm:hover:not(:disabled) {
  background: var(--sage);
}
.btn-sm:disabled {
  opacity: 0.6;
  cursor: default;
  background: var(--sage-light);
  color: var(--sage-dark);
}

/* Admin ticket groups */
.admin-ticket-group {
  margin-bottom: 28px;
}
.admin-ticket-group h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ticket-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.ticket-header-row h4 {
  margin: 0;
}

/* Rent edit controls (admin) */
.rent-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.rent-prefix {
  color: var(--muted);
  font-size: 0.9rem;
  flex-shrink: 0;
  line-height: 1;
}
.rent-input {
  width: 72px;
  min-width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--ivory);
  color: var(--charcoal);
  flex-shrink: 0;
}
.rent-input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(122, 143, 122, 0.15);
}
.rent-edit .btn-sm {
  flex-shrink: 0;
}
