/* ========================================================================
   PrimeDwell — modern student housing investment platform
   Theme: soft-light surfaces, deep ink text, vibrant indigo/violet accents,
          rounded geometry, layered shadows, subtle gradients.
   ========================================================================*/

:root {
  /* Surfaces */
  --bg:        #f6f7fb;
  --bg-2:      #ffffff;
  --bg-3:      #eef0f7;
  --surface:   #ffffff;
  --line:      #e5e7ef;
  --line-2:    #eef0f7;

  /* Text */
  --text:      #0f1226;
  --text-2:    #2a2d4a;
  --muted:     #6b7090;
  --muted-2:   #9aa0bd;

  /* Brand — indigo to violet gradient */
  --brand-1:   #6366f1;   /* indigo-500 */
  --brand-2:   #8b5cf6;   /* violet-500 */
  --brand-3:   #a855f7;   /* purple-500 */
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;

  /* Accents */
  --accent:    #f59e0b;   /* amber */
  --mpesa:     #00b14f;   /* Safaricom green */
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #3b82f6;

  /* Effects */
  --grad:      linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.10), rgba(168,85,247,.10));
  --ring:      0 0 0 4px rgba(99,102,241,.16);

  --shadow-sm: 0 1px 2px rgba(15,18,38,.06), 0 1px 1px rgba(15,18,38,.04);
  --shadow:    0 4px 16px rgba(15,18,38,.06), 0 2px 4px rgba(15,18,38,.04);
  --shadow-lg: 0 20px 50px -10px rgba(99,102,241,.25), 0 10px 20px rgba(15,18,38,.06);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(168,85,247,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(99,102,241,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-1); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-3); }

h1, h2, h3, h4 {
  font-family: var(--font);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 .55em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.18; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1rem; color: var(--text-2); }

.muted { color: var(--muted); }
.muted.small, .small { font-size: .85rem; color: var(--muted); }
.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: -.02em;
  box-shadow: 0 6px 18px rgba(139,92,246,.35);
}
.brand-name { font-weight: 800; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: var(--text-2);
  font-weight: 500;
  font-size: .95rem;
}
.nav-links a:hover { color: var(--text); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: .94rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(99,102,241,.55);
}
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(99,102,241,.6); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-dark {
  background: #0f1226;
  color: #fff;
}
.btn-dark:hover { background: #1a1e44; color: #fff; }
.btn-success {
  background: var(--mpesa);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(0,177,79,.45);
}
.btn-success:hover { color: #fff; transform: translateY(-1px); }
.btn-block { width: 100%; padding: 13px 22px; font-size: 1rem; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 420px at 80% 10%, rgba(139,92,246,.18), transparent 60%),
    radial-gradient(700px 400px at 10% 90%, rgba(99,102,241,.13), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

.hero h1 { max-width: 980px; }
.hero .lead {
  font-size: 1.18rem;
  color: var(--text-2);
  max-width: 660px;
  margin: 18px 0 28px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,.18);
  margin-bottom: 22px;
  text-decoration: none;
}
.pill-active, .pill.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero-stats .stat .v { font-size: 1.55rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.hero-stats .stat .l { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* ============ Sections ============ */
.section { padding: 70px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 6px; }
.section-head p  { color: var(--muted); margin: 0; }

/* ============ Cards / Grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,.25);
}
.card-img {
  position: relative;
  height: 195px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
}
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(15,18,38,.55) 100%);
}
.card-img > * { position: relative; z-index: 1; }

.tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(255,255,255,.94);
  color: var(--text);
  backdrop-filter: blur(6px);
  letter-spacing: -.01em;
}
.tag.loc-Kenyatta-University    { background: rgba(99,102,241,.94); color: #fff; }
.tag.loc-JKUAT                  { background: rgba(16,185,129,.94); color: #fff; }
.tag.loc-Moi-University         { background: rgba(245,158,11,.94); color: #fff; }

.yield {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #0f1226;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card-body { padding: 18px 20px 4px; flex: 1; }
.card-body h3 { margin-bottom: 6px; }
.card-body .pitch {
  color: var(--muted);
  font-size: .92rem;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--grad);
  border-radius: 999px;
  transition: width .4s ease;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .85rem;
  margin: 4px 0 14px;
}
.card-footer {
  border-top: 1px solid var(--line-2);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ============ How it works / Steps ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.step:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.step .n {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad-soft);
  color: var(--brand-2);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.step h3 { margin-bottom: 4px; }

/* ============ Testimonials ============ */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.testimonial {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.testimonial blockquote {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: .98rem;
  line-height: 1.55;
}
.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line-2);
  padding-top: 14px;
}
.testimonial figcaption img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
}
.t-name { font-weight: 700; color: var(--text); }
.t-meta { font-size: .82rem; color: var(--muted); }
.t-proj { font-size: .8rem; color: var(--brand-2); margin-top: 2px; font-weight: 600; }

/* ============ FAQ ============ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .15s ease;
}
.faq details[open] { border-color: rgba(99,102,241,.4); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand-2);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* ============ Forms ============ */
.form-wrap {
  max-width: 480px;
  margin: 60px auto;
  padding: 34px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.form-wrap h2 { margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .82rem;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: var(--ring);
  background: var(--surface);
}
.form-foot {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: .9rem;
}

/* ============ Flash ============ */
.flash {
  padding: 12px 0;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.flash-success { background: #ecfdf5; color: #047857; }
.flash-error   { background: #fef2f2; color: #b91c1c; }
.flash-info    { background: #eff6ff; color: #1d4ed8; }

/* ============ Project hero ============ */
.project-hero {
  position: relative;
  min-height: 380px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 60px 0 50px;
  color: #fff;
}
.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,18,38,.2) 0%, rgba(15,18,38,.85) 100%);
}
.project-hero .container { position: relative; }
.project-hero h1 { color: #fff; margin-bottom: 8px; }

.project-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 50px;
  padding: 60px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .project-layout { grid-template-columns: 1fr; padding: 40px 24px; }
}

.invest-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 96px;
  height: fit-content;
}

.divider {
  height: 1px;
  background: var(--line-2);
  margin: 22px 0;
}

.kvs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.kv {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.kv .l { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kv .v { font-weight: 700; color: var(--text); font-size: 1rem; margin-top: 2px; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ============ Tables ============ */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.tbl th, .tbl td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: .92rem;
}
.tbl th {
  background: var(--bg);
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--bg); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-pending,
.badge-scheduled  { background: #fef3c7; color: #92400e; }
.badge-confirmed,
.badge-paid       { background: #d1fae5; color: #047857; }
.badge-failed,
.badge-cancelled  { background: #fee2e2; color: #b91c1c; }

/* M-Pesa badge */
.mpesa-badge {
  display: inline-block;
  background: var(--mpesa);
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: .85rem;
}

/* ============ Dashboard ============ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 20px 0 10px;
}
.dash-grid .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-grid .stat .l {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.dash-grid .stat .v {
  font-size: 1.55rem;
  font-weight: 800;
  margin-top: 6px;
  color: var(--text);
  letter-spacing: -.02em;
}

/* ============ Footer ============ */
.footer {
  background: #0f1226;
  color: #c8cce8;
  padding: 60px 0 30px;
  margin-top: 80px;
}
.footer h4 { color: #fff; margin-bottom: 14px; font-size: .95rem; }
.footer .brand { color: #fff; }
.footer .brand-name { color: #fff; }
.footer .muted { color: #9aa0bd; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 8px; }
.footer ul a { color: #c8cce8; font-size: .92rem; }
.footer ul a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .85rem;
  color: #9aa0bd;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .nav-inner { height: 64px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.btn) { display: none; }
  .nav-links a.btn { display: inline-flex; }
  .hero { padding: 60px 0 50px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 50px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .form-wrap { margin: 30px 16px; padding: 26px 22px; }
  .invest-box { position: static; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
