/* =========================================================
   Lockeasy Design System — premium rental SaaS
   ========================================================= */
:root {
  --ink: #0b1f2a;
  --ink-soft: #1a3544;
  --slate: #4a6572;
  --muted: #7a93a0;
  --line: #e4eef2;
  --bg: #f4f8fa;
  --white: #ffffff;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #ccfbf1;
  --gold: #d4a017;
  --gold-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #d97706;
  --warn-soft: #ffedd5;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --success: #059669;
  --success-soft: #d1fae5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(11, 31, 42, 0.08);
  --shadow-sm: 0 4px 16px rgba(11, 31, 42, 0.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; color: var(--slate); }
ul { padding-left: 1.1rem; }

/* ---- Utilities ---- */
.container { width: min(1180px, 92%); margin: 0 auto; }
.container-sm { width: min(480px, 92%); margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.flex-center { display: flex; align-items: center; gap: .75rem; }
.gap-1 { gap: .5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--muted); }
.text-sm { font-size: .875rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 999px; border: none;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: .2s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; box-shadow: 0 8px 24px rgba(13, 148, 136, .3);
}
.btn-primary:hover { filter: brightness(1.05); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: var(--white); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-weight: 600; font-size: .875rem;
  margin-bottom: .4rem; color: var(--ink-soft);
}
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: var(--white);
  color: var(--ink); transition: border .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .15);
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }

/* ---- Cards ---- */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(228, 238, 242, .8);
  overflow: hidden;
}
.card-body { padding: 1.35rem; }
.card-header {
  padding: 1rem 1.35rem; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.05rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; padding: .25rem .65rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #eef2f4; color: var(--muted); }

/* ---- Alerts / Flash ---- */
.flash-stack { position: fixed; top: 1rem; right: 1rem; z-index: 1000; display: grid; gap: .5rem; max-width: min(400px, 92vw); }
.alert {
  padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .9rem; box-shadow: var(--shadow);
  animation: slideIn .3s ease;
}
.alert-success { background: var(--success-soft); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--info-soft); color: #075985; border: 1px solid #bae6fd; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: .925rem;
}
table.data th {
  text-align: left; padding: .85rem 1rem; color: var(--muted);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); font-weight: 700;
}
table.data td {
  padding: .95rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafcfd; }

/* =========================================================
   LANDING
   ========================================================= */
.landing { background: var(--white); }
.landing-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); background: rgba(255,255,255,.85);
  border-bottom: 1px solid rgba(228,238,242,.7);
}
.landing-nav .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #115e59);
  display: grid; place-items: center; color: #fff; font-size: 1rem;
  box-shadow: 0 6px 16px rgba(13,148,136,.35);
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--slate); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--teal-dark); }

.hero {
  position: relative; padding: 5rem 0 4rem; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(13,148,136,.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(212,160,23,.1), transparent 50%),
    linear-gradient(180deg, #f8fbfc 0%, #fff 100%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--teal-soft); color: var(--teal-dark);
  padding: .4rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  letter-spacing: -.02em; color: var(--ink); margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--teal), #0f766e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: 1.15rem; max-width: 34rem; margin-bottom: 1.75rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }
.hero-stats {
  display: flex; gap: 2rem; flex-wrap: wrap;
}
.hero-stats div strong {
  display: block; font-size: 1.4rem; color: var(--ink); font-weight: 800;
}
.hero-stats div span { font-size: .85rem; color: var(--muted); }

.hero-card {
  background: var(--white); border-radius: 24px; padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(11,31,42,.12); border: 1px solid var(--line);
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(13,148,136,.4), transparent 40%, rgba(212,160,23,.3));
  z-index: -1; opacity: .5;
}
.mini-dash-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem;
}
.mini-dash-header strong { font-size: .95rem; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.mini-kpi {
  background: var(--bg); border-radius: 12px; padding: .9rem;
}
.mini-kpi span { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.mini-kpi strong { font-size: 1.15rem; }
.mini-property {
  display: flex; gap: .85rem; align-items: center;
  padding: .75rem; border-radius: 12px; border: 1px solid var(--line);
  margin-bottom: .5rem;
}
.mini-property .thumb {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, #99f6e4, #5eead4);
  flex-shrink: 0;
}
.mini-property .meta { flex: 1; min-width: 0; }
.mini-property .meta strong { display: block; font-size: .9rem; }
.mini-property .meta span { font-size: .8rem; color: var(--muted); }

.section { padding: 5rem 0; }
.section-alt { background: var(--bg); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: .75rem;
}
.feature-card {
  background: var(--white); border-radius: var(--radius); padding: 1.75rem;
  border: 1px solid var(--line); height: 100%;
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.35rem;
  margin-bottom: 1rem;
  background: var(--teal-soft);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.feature-card p { margin: 0; font-size: .95rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: step; }
.step {
  position: relative; padding: 1.5rem; background: var(--white);
  border-radius: var(--radius); border: 1px solid var(--line);
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; font-weight: 800; margin-bottom: 1rem;
}

.pricing-card {
  background: var(--white); border-radius: 20px; padding: 2rem;
  border: 1px solid var(--line); position: relative;
}
.pricing-card.featured {
  border-color: var(--teal);
  box-shadow: 0 20px 50px rgba(13,148,136,.15);
  transform: scale(1.03);
}
.pricing-card.featured::after {
  content: "Recommandé"; position: absolute; top: -12px; right: 1.5rem;
  background: var(--gold); color: #fff; font-size: .75rem; font-weight: 700;
  padding: .3rem .75rem; border-radius: 999px;
}
.price { font-size: 2.5rem; font-weight: 800; color: var(--ink); margin: .5rem 0; }
.price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.pricing-card ul { list-style: none; padding: 0; margin: 1.25rem 0 1.75rem; }
.pricing-card li {
  padding: .45rem 0 .45rem 1.6rem; position: relative; color: var(--slate); font-size: .95rem;
}
.pricing-card li::before {
  content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800;
}

.cta-band {
  margin: 2rem 0 5rem; border-radius: 28px; padding: 3.5rem 2rem; text-align: center;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 50%, #0b3d4a 100%);
  color: #fff; position: relative; overflow: hidden;
}
.cta-band h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.4rem); color: #fff; }
.cta-band p { color: rgba(255,255,255,.8); max-width: 480px; margin: .75rem auto 1.5rem; }
.cta-band .btn-primary {
  background: #fff; color: var(--teal-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.cta-band .btn-secondary {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.35);
}

.landing-footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0; background: var(--white);
}
.landing-footer .inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.landing-footer p { margin: 0; font-size: .9rem; }

/* =========================================================
   AUTH
   ========================================================= */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: linear-gradient(160deg, #0f766e 0%, #0b3d4a 100%);
  color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,.06); bottom: -100px; right: -100px;
}
.auth-brand h1 {
  font-family: var(--display); font-weight: 600; font-size: 2.2rem; color: #fff; margin-top: 2rem;
}
.auth-brand p { color: rgba(255,255,255,.75); max-width: 360px; }
.auth-form-wrap {
  display: grid; place-items: center; padding: 2rem; background: var(--bg);
}
.auth-card {
  width: min(420px, 100%); background: var(--white); border-radius: 20px;
  padding: 2rem; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.auth-card h2 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-card .subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--ink); color: #fff;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
}
.sidebar-brand {
  padding: 1.35rem 1.25rem; display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo { color: #fff; font-size: 1.15rem; }
.sidebar-nav { padding: 1rem .75rem; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem; border-radius: 10px; color: rgba(255,255,255,.7);
  font-weight: 500; font-size: .925rem; margin-bottom: .25rem; transition: .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(13,148,136,.9), rgba(15,118,110,.9));
  color: #fff; box-shadow: 0 4px 12px rgba(13,148,136,.3);
}
.sidebar-nav .nav-icon { width: 1.25rem; text-align: center; opacity: .9; }
.sidebar-footer {
  padding: 1rem; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: .75rem; padding: .5rem;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .meta { min-width: 0; }
.sidebar-user .meta strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta span { font-size: .75rem; color: rgba(255,255,255,.5); }

.main {
  margin-left: var(--sidebar); flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 1rem 1.75rem;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.page { padding: 1.75rem; flex: 1; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.kpi {
  background: var(--white); border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 1.75rem; font-weight: 800; margin: .35rem 0 .15rem; color: var(--ink); }
.kpi .hint { font-size: .8rem; color: var(--teal-dark); font-weight: 600; }

/* Property cards */
.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.property-card { display: flex; flex-direction: column; height: 100%; }
.property-card .cover {
  height: 160px; background: linear-gradient(135deg, #99f6e4, #5eead4, #2dd4bf);
  position: relative; overflow: hidden;
}
.property-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.property-card .body { padding: 1.15rem; flex: 1; display: flex; flex-direction: column; }
.property-card .rent { font-weight: 800; color: var(--teal-dark); font-size: 1.1rem; margin-top: auto; padding-top: .75rem; }

.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* Detail */
.detail-hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
.detail-cover {
  border-radius: var(--radius); height: 280px; overflow: hidden;
  background: linear-gradient(135deg, #99f6e4, #2dd4bf);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Mobile */
.menu-toggle {
  display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink);
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid, .detail-hero, .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .grid-3, .steps, .grid-4 { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%); transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-row, .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .nav-links .hide-mobile { display: none; }
  .page { padding: 1rem; }
  .topbar { padding: 1rem; }
}

/* Page specific helpers */
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stack-sm > * + * { margin-top: .75rem; }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.legal-note { font-size: .8rem; color: var(--muted); margin-top: 2rem; }
