/* =========================================================================
   teajaypierce.com — Forest + Sunset
   Palette:
     Forest:  #0a1812 → #142d1f → #1f4231 → #2f6044 (deep → mid)
     Cream:   #f4ecd6 / #d8cfba (text)
     Sunset:  #b8480f → #d2691e → #e87722 → #f4a25c (burnt orange)
   ========================================================================= */

:root {
  --forest-0: #08110b;      /* darkest — page bg base */
  --forest-1: #0d1f15;
  --forest-2: #142d1f;
  --forest-3: #1c3e2a;
  --forest-4: #2a5a3e;
  --forest-5: #3d7a55;

  --cream-0:  #f4ecd6;       /* primary text */
  --cream-1:  #d8cfba;       /* muted text */
  --cream-2:  #8a8773;       /* faintest text */

  --sunset-1: #b8480f;       /* deep burnt */
  --sunset-2: #d2691e;       /* core */
  --sunset-3: #e87722;       /* bright */
  --sunset-4: #f4a25c;       /* highlight */

  --line:     #1a3525;
  --line-2:   #234731;

  --shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 119, 34, 0.15);

  --radius:     14px;
  --radius-sm:  8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--forest-0);
  color: var(--cream-0);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Painterly forest-at-dusk background */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 18% 8%,  rgba(232, 119, 34, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 0%,  rgba(244, 162, 92, 0.10) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%,rgba(45, 122, 85, 0.20) 0%, transparent 60%),
    linear-gradient(180deg, #0a1812 0%, #08110b 50%, #050a07 100%);
}
.bg-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(244, 236, 214, 0.025) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 32px 12px;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand--centered {
  justify-content: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--sunset-2) 0%, var(--sunset-3) 100%);
  color: #1a0e05;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(210, 105, 30, 0.35);
}

.brand-text {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
  color: var(--cream-0);
}

.logout {
  font-size: 13px;
  color: var(--cream-2);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.15s ease;
}
.logout:hover {
  color: var(--sunset-3);
  border-color: var(--sunset-2);
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--cream-0) 0%, var(--sunset-4) 60%, var(--sunset-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--cream-1);
  max-width: 560px;
  margin: 0 0 12px;
  line-height: 1.55;
}

/* ─── Tile grid ──────────────────────────────────────────────────────── */
.tiles {
  max-width: 1180px;
  margin: 24px auto 60px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 24px;
  background: linear-gradient(180deg, var(--forest-2) 0%, var(--forest-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--cream-0);
  min-height: 240px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--forest-4) 0%, var(--forest-5) 100%);
  transition: background 0.25s ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(232, 119, 34, 0.0) 0%, transparent 60%);
  transition: background 0.25s ease;
}

.tile:not(.tile--soon):hover {
  transform: translateY(-4px);
  border-color: var(--sunset-2);
  box-shadow: var(--shadow-lift);
}
.tile:not(.tile--soon):hover::before {
  background: linear-gradient(90deg, var(--sunset-1) 0%, var(--sunset-3) 100%);
}
.tile:not(.tile--soon):hover::after {
  background: radial-gradient(circle at top right, rgba(232, 119, 34, 0.18) 0%, transparent 60%);
}

.tile-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 18px;
  filter: drop-shadow(0 2px 8px rgba(232, 119, 34, 0.25));
}

.tile-body { flex: 1; }

.tile-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sunset-3);
  background: rgba(232, 119, 34, 0.10);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid rgba(232, 119, 34, 0.25);
}
.tile-tag.tag--soon {
  color: var(--cream-2);
  background: rgba(244, 236, 214, 0.04);
  border-color: var(--line-2);
}
.tile-tag.tag--ireland {
  color: #4ea96a;
  background: rgba(78, 169, 106, 0.10);
  border-color: rgba(78, 169, 106, 0.30);
}
.tile--ireland::before {
  background: linear-gradient(90deg, #2a5a3e 0%, #4ea96a 100%);
}
.tile--ireland:hover::before {
  background: linear-gradient(90deg, #4ea96a 0%, var(--sunset-3) 100%);
}

.tile-tag.tag--budget {
  color: #f4a25c;
  background: rgba(244, 162, 92, 0.10);
  border-color: rgba(244, 162, 92, 0.30);
}
.tile--budget::before {
  background: linear-gradient(90deg, #3d7a55 0%, #f4a25c 100%);
}
.tile--budget:hover::before {
  background: linear-gradient(90deg, #f4a25c 0%, var(--sunset-3) 100%);
}

/* ─── Lease calculator tile ───────────────────────────────────────── */
.tile--lease {
  cursor: default;          /* not a link */
}
.tile--lease:hover {
  /* don't lift on hover — it's interactive content */
  transform: none;
  border-color: var(--line);
}
.tile--lease::before { background: linear-gradient(90deg, #5b6f8a 0%, #8aa3c2 100%); }
.tile-tag.tag--calc {
  color: #b6c5dc;
  background: rgba(138, 163, 194, 0.10);
  border-color: rgba(138, 163, 194, 0.28);
}

.lease-input { margin-bottom: 14px; }
.lease-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.lease-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 17, 11, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lease-input-row:focus-within {
  border-color: #8aa3c2;
  box-shadow: 0 0 0 3px rgba(138, 163, 194, 0.12);
}
.lease-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 6px 0;
  width: 100%;
}
.lease-input-row input::-webkit-outer-spin-button,
.lease-input-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lease-input-row input[type=number] { -moz-appearance: textfield; }
.lease-unit { color: var(--muted); font-size: 13px; }

.lease-bar { margin: 12px 0 14px; }
.lease-bar-track {
  position: relative;
  height: 10px;
  background: rgba(8, 17, 11, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.lease-bar-used {
  height: 100%;
  background: linear-gradient(90deg, #4ea96a 0%, var(--sunset-3) 100%);
  width: 0%;
  transition: width 0.25s ease;
  border-radius: 999px;
}
.lease-bar-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text);
  left: 0;
  transition: left 0.25s ease;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.5);
}
.lease-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lease-stats { gap: 6px !important; }
.lease-stats em { color: var(--muted); font-style: normal; font-size: 12px; }

.lease-cta {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.lease-cta-num {
  font-family: 'Chakra Petch', 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.lease-cta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.lease-cta.lease-over  .lease-cta-num   { color: #ff8a8a; }
.lease-cta.lease-under .lease-cta-num   { color: #7fdc9e; }

.tile-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  color: var(--cream-0);
}

.tile-desc {
  margin: 0;
  color: var(--cream-1);
  font-size: 14px;
  line-height: 1.55;
}

/* Live data inside tiles */
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--cream-1);
}
.tile-meta b { color: var(--cream-0); font-weight: 600; }

.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pill--ok     { color: #7fdc9e; background: rgba(127, 220, 158, 0.10); border-color: rgba(127, 220, 158, 0.25); }
.pill--warn   { color: var(--sunset-4); background: rgba(244, 162, 92, 0.10); border-color: rgba(244, 162, 92, 0.30); }
.pill--locked { color: #ff8a8a; background: rgba(255, 138, 138, 0.10); border-color: rgba(255, 138, 138, 0.25); }

.tile-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile-leaderboard li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(8, 17, 11, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.tile-leaderboard li:first-child {
  border-color: rgba(232, 119, 34, 0.35);
  background: linear-gradient(90deg, rgba(232, 119, 34, 0.08) 0%, rgba(8, 17, 11, 0.4) 100%);
}
.lb-rank {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  text-align: center;
  color: var(--sunset-3);
}
.tile-leaderboard li:not(:first-child) .lb-rank { color: var(--cream-2); }
.lb-name {
  color: var(--cream-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-pts {
  font-variant-numeric: tabular-nums;
  color: var(--cream-1);
  font-size: 12px;
}

.tile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.tile-list li:last-child { border-bottom: none; }
.row-label {
  color: var(--cream-2);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
}
.row-val {
  color: var(--cream-0);
  text-align: right;
}
.row-val em { color: var(--sunset-3); font-style: normal; font-size: 11px; }

.tile-cta {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--sunset-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tile-cta .arrow { transition: transform 0.2s ease; display: inline-block; }
.tile:hover .tile-cta .arrow { transform: translateX(4px); }
.tile-cta.cta--soon { color: var(--cream-2); }

.tile--soon {
  background: linear-gradient(180deg, rgba(20, 45, 31, 0.5) 0%, rgba(13, 31, 21, 0.5) 100%);
  border-style: dashed;
  cursor: default;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px;
  color: var(--cream-2);
  font-size: 13px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.foot .dot { opacity: 0.5; }
.foot--centered { justify-content: center; }

/* ─── Login page ─────────────────────────────────────────────────────── */
body.centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--forest-2) 0%, var(--forest-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 32px 32px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sunset-1) 0%, var(--sunset-3) 100%);
}

.login-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.5px;
}
.login-sub {
  text-align: center;
  color: var(--cream-1);
  font-size: 14px;
  margin: 0 0 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--cream-1);
}
.field input {
  background: rgba(8, 17, 11, 0.6);
  border: 1px solid var(--line-2);
  color: var(--cream-0);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--sunset-2);
  box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.12);
}

.btn-primary {
  margin-top: 8px;
  background: linear-gradient(135deg, var(--sunset-2) 0%, var(--sunset-1) 100%);
  color: #1a0e05;
  border: none;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 4px 14px rgba(184, 72, 15, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(232, 119, 34, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.flash {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(204, 85, 0, 0.10);
  border: 1px solid rgba(204, 85, 0, 0.30);
  border-radius: var(--radius-sm);
  list-style: none;
  color: var(--sunset-4);
  font-size: 13px;
}
.flash li { margin: 0; }

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 24px 20px 8px; }
  .hero-inner { margin-bottom: 36px; }
  .tiles { padding: 0 20px; gap: 16px; }
  .tile { min-height: auto; padding: 22px 20px 20px; }
  .login-card { padding: 32px 24px 28px; }
}
