@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --orange: #e87722;
  --orange-light: rgba(232,119,34,0.1);
  --ink: #1a1a18;
  --paper: #fafaf8;
  --grey: #6b7280;
  --grey-light: #f3f4f6;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: 'Inter', -apple-system, sans-serif; min-height: 100vh; }

/* ---------- NAVBAR ---------- */
.nav {
  background: var(--ink);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.nav-logo-text { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700; }
.nav-logo-text span:first-child { color: var(--orange); }
.nav-logo-text span:last-child { color: #9ca3af; font-weight: 300; }
.nav-user { color: #9ca3af; font-size: 0.85rem; }
.nav-logout { background: none; border: 1px solid rgba(255,255,255,0.15); color: #d1d5db; 
              padding: 0.35rem 0.85rem; border-radius: 6px; cursor: pointer; font-size: 0.82rem;
              transition: all 0.15s; margin-left: 1rem; }
.nav-logout:hover { border-color: rgba(255,255,255,0.35); color: white; }

/* ---------- PAGE SHELL ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-sm { max-width: 480px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ---------- HEADINGS ---------- */
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; line-height: 1.2; }
.page-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.page-subtitle { color: var(--grey); font-size: 0.9rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  border: none; text-decoration: none; transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: #d06a18; }
.btn-secondary { background: var(--grey-light); color: var(--ink); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--grey-light); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- FORM ELEMENTS ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--ink); margin-bottom: 0.4rem; letter-spacing: 0.01em; }
.form-label .required { color: var(--orange); margin-left: 0.2rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; font-family: inherit; color: var(--ink);
  background: white; transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-light);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 0.77rem; color: var(--grey); margin-top: 0.3rem; }

/* ---------- CARD ---------- */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 1.5rem; }
.card-title { font-size: 1.1rem; font-weight: 600; font-family: 'Inter', sans-serif; }

/* ---------- BADGE ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-expired { background: #f3f4f6; color: #6b7280; }
.badge-draft { background: #fef3c7; color: #92400e; }

/* ---------- TABLE (dashboard) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: white; }
thead { background: var(--grey-light); }
th { padding: 0.75rem 1rem; text-align: left; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); white-space: nowrap; }
td { padding: 0.9rem 1rem; font-size: 0.88rem; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #fafaf8; }
.td-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- EMPTY STATE ---------- */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--grey); }
.empty-state h2 { font-size: 1.25rem; margin-bottom: 0.5rem; font-family: 'Inter', sans-serif; font-weight: 500; }
.empty-state p { font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ---------- TOAST / ALERT ---------- */
.alert { padding: 0.85rem 1.1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: 0.6rem; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--ink); color: white; padding: 0.85rem 1.25rem; border-radius: 10px; font-size: 0.875rem; box-shadow: var(--shadow-lg); max-width: 360px; animation: slideIn 0.2s ease; }
.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--orange); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- PROGRESS BAR ---------- */
.progress-wrap { background: var(--grey-light); border-radius: 4px; height: 6px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar { height: 100%; background: var(--orange); border-radius: 4px; transition: width 0.3s ease; }

/* ---------- LOGIN ---------- */
.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink); padding: 1.5rem;
}
.login-card {
  background: white; border-radius: 16px; padding: 2.5rem 2rem;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .wordmark { font-size: 1.75rem; font-weight: 700; }
.login-logo .wordmark span:first-child { color: var(--orange); }
.login-logo .wordmark span:last-child { color: var(--grey); font-weight: 300; }
.login-logo .tagline { color: var(--grey); font-size: 0.82rem; margin-top: 0.3rem; }
.login-title { font-size: 1.4rem; margin-bottom: 0.4rem; }
.login-subtitle { color: var(--grey); font-size: 0.88rem; margin-bottom: 1.75rem; }

/* ---------- SECTIONS / DIVIDERS ---------- */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.section-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey); margin-bottom: 1rem; }

/* ---------- PHOTO UPLOAD ---------- */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 2rem;
  text-align: center; cursor: pointer; transition: all 0.15s; background: white;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--orange); background: var(--orange-light); }
.upload-zone p { color: var(--grey); font-size: 0.88rem; margin-top: 0.5rem; }
.upload-zone .upload-icon { font-size: 2rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 1rem; }
.photo-thumb {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: var(--grey-light); cursor: grab;
}
.photo-thumb img, .photo-thumb video { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6); color: white; border: none;
  border-radius: 50%; width: 22px; height: 22px; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.photo-thumb .video-indicator {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.6); color: white; border-radius: 4px;
  font-size: 0.65rem; padding: 2px 5px;
}

/* ---------- PROPERTY BLOCK (in create form) ---------- */
.property-block {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 1.5rem;
  transition: box-shadow 0.15s;
}
.property-block:focus-within { box-shadow: 0 0 0 3px var(--orange-light); border-color: var(--orange); }
.property-block-header {
  background: var(--grey-light); padding: 0.85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.property-block-header h3 { font-family: 'Inter', sans-serif; font-size: 0.92rem; font-weight: 600; }
.property-block-body { padding: 1.25rem; }
.property-block-body.collapsed { display: none; }

/* ---------- FEATURE CHECKBOXES ---------- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; }
.feature-checkbox { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.feature-checkbox input { accent-color: var(--orange); width: 15px; height: 15px; cursor: pointer; }
.feature-checkbox span { font-size: 0.85rem; }

/* ---------- LANGUAGE SELECTOR ---------- */
.lang-selector { display: flex; gap: 0.5rem; }
.lang-btn {
  padding: 0.4rem 1rem; border-radius: 6px; font-size: 0.85rem; cursor: pointer;
  border: 1.5px solid var(--border); background: white; transition: all 0.15s;
}
.lang-btn.active { border-color: var(--orange); background: var(--orange-light); color: var(--orange); font-weight: 600; }

/* ---------- STATS BAR (dashboard) ---------- */
.stats-bar { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: 10px; padding: 1rem 1.25rem; flex: 1; min-width: 120px; box-shadow: var(--shadow); }
.stat-value { font-size: 1.75rem; font-weight: 700; font-family: 'Cormorant Garamond', serif; color: var(--orange); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--grey); margin-top: 0.25rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .page { padding: 1.25rem 1rem; }
  .page-title { font-size: 1.5rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5) { display: none; }
}