/* ============================================================
   Astrosage — Cosmic / celestial theme
   Dark night-sky indigo with gold accents.
   ============================================================ */

:root {
  --bg-deep:     #1a2032;
  --bg-mid:      #2a3349;
  --bg-panel:    rgba(54, 64, 90, 0.45);
  --bg-panel-2:  rgba(66, 78, 108, 0.55);
  --gold:        #b7c0d8;
  --gold-soft:   #d4dae9;
  --gold-deep:   #8a93ad;
  --indigo-line: rgba(183, 192, 216, 0.16);
  --text:        #edf0f7;
  --text-dim:    #aeb4c8;
  --danger:      #ff8a8a;
  --success:     #8ef0bf;
  --radius:      16px;
  --maxw:        1080px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 75% -10%, #3a4a72 0%, transparent 55%),
    radial-gradient(900px 600px at 10% 10%, #2c3856 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Starfield — three layers of tiny dots */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff 50%, transparent),
    radial-gradient(1px 1px at 85% 60%, #fff 50%, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 15% 85%, #fff 50%, transparent),
    radial-gradient(1px 1px at 90% 90%, #fff 50%, transparent),
    radial-gradient(1px 1px at 33% 15%, #fff 50%, transparent);
  opacity: 0.55;
}

.serif {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / nav */
.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--indigo-line);
  backdrop-filter: blur(6px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  font-size: 1.6rem;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(183,192,216,0.28));
}
.brand .name {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gold-soft);
}
.brand .name small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: "Inter", sans-serif;
}
nav.menu { display: flex; gap: 22px; align-items: center; }
nav.menu a {
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}
nav.menu a:hover { color: var(--gold-soft); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #20183a;
  box-shadow: 0 4px 16px rgba(36,46,72,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(36,46,72,0.5); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid var(--gold-deep);
  box-shadow: none;
}

/* Hero */
.hero { text-align: center; padding: 90px 0 70px; position: relative; z-index: 1; }
.hero h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 600;
  margin: 0 0 18px;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  max-width: 640px;
  margin: 0 auto 34px;
  font-size: 1.2rem;
  color: var(--text-dim);
}
.hero .cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Section headings */
.section { padding: 60px 0; position: relative; z-index: 1; }
.section h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.4rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 8px;
  color: var(--gold-soft);
}
.section .sub {
  text-align: center;
  color: var(--text-dim);
  margin: 0 auto 44px;
  max-width: 560px;
}

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.card {
  background: var(--bg-panel);
  border: 1px solid var(--indigo-line);
  border-radius: var(--radius);
  padding: 30px 26px;
  backdrop-filter: blur(8px);
}
.card .icon { font-size: 2rem; margin-bottom: 14px; }
.card h3 { font-size: 1.25rem; margin: 0 0 10px; color: var(--gold-soft); font-weight: 600; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.98rem; }

/* Forms */
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--indigo-line);
  border-radius: var(--radius);
  padding: 38px 34px;
  backdrop-filter: blur(8px);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.9rem; color: var(--text-dim); letter-spacing: 0.3px; }
.field label .req { color: var(--gold); }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: rgba(10,10,30,0.5);
  border: 1px solid var(--indigo-line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(183,192,216,0.14);
}
.field textarea { resize: vertical; min-height: 110px; }
.field .hint { font-size: 0.8rem; color: var(--text-dim); }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--gold-deep); }
.checkbox-row label { font-size: 0.92rem; color: var(--text-dim); }

/* Honeypot — hidden from humans, catches bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { margin-top: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* Status messages */
.alert {
  display: none;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 0.96rem;
}
.alert.show { display: block; }
.alert.ok    { background: rgba(142,240,191,0.12); border: 1px solid rgba(142,240,191,0.4); color: var(--success); }
.alert.error { background: rgba(255,138,138,0.12); border: 1px solid rgba(255,138,138,0.4); color: var(--danger); }

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--indigo-line);
  margin-top: 60px;
  padding: 34px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.site-footer .brand { justify-content: center; margin-bottom: 10px; }

/* Page intro band for sub-pages */
.page-intro { text-align: center; padding: 64px 0 10px; position: relative; z-index: 1; }
.page-intro h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--gold-soft);
}
.page-intro p { color: var(--text-dim); max-width: 560px; margin: 0 auto; }

/* ============================================================
   ADMIN — login + dashboard
   ============================================================ */

/* Login card */
.login-wrap {
  max-width: 400px;
  margin: 80px auto 0;
  background: var(--bg-panel);
  border: 1px solid var(--indigo-line);
  border-radius: var(--radius);
  padding: 40px 34px;
  backdrop-filter: blur(8px);
}
.login-wrap h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 6px;
  color: var(--gold-soft);
}
.login-wrap .sub { text-align: center; color: var(--text-dim); margin: 0 0 28px; font-size: 0.95rem; }
.login-wrap .field { margin-bottom: 18px; }
.login-wrap .btn { width: 100%; }

/* Dashboard header bar */
.admin-bar {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--indigo-line);
  backdrop-filter: blur(6px);
}
.admin-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; flex-wrap: wrap; gap: 12px;
}
.admin-bar .who { color: var(--text-dim); font-size: 0.9rem; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin: 30px 0 22px; flex-wrap: wrap; }
.tab {
  cursor: pointer; border: 1px solid var(--indigo-line); background: transparent;
  color: var(--text-dim); font: inherit; padding: 9px 20px; border-radius: 999px;
  transition: all 0.15s ease;
}
.tab.active { background: var(--bg-panel-2); color: var(--gold-soft); border-color: var(--gold-deep); }
.tab .count {
  display: inline-block; margin-left: 8px; font-size: 0.78rem;
  background: rgba(183,192,216,0.18); color: var(--text); padding: 1px 8px; border-radius: 999px;
}

/* Data table */
.table-wrap {
  background: var(--bg-panel); border: 1px solid var(--indigo-line);
  border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(8px);
}
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left; padding: 14px 18px; font-size: 0.93rem;
  border-bottom: 1px solid var(--indigo-line);
}
table.data th { color: var(--text-dim); font-weight: 600; letter-spacing: 0.3px; font-size: 0.82rem; text-transform: uppercase; }
table.data tbody tr { cursor: pointer; transition: background 0.12s ease; }
table.data tbody tr:hover { background: rgba(183,192,216,0.06); }
table.data tbody tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: var(--text-dim); padding: 40px; }

/* Status badges */
.badge {
  display: inline-block; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.4px;
  padding: 3px 11px; border-radius: 999px; text-transform: capitalize;
}
.badge.new       { background: rgba(183,192,216,0.18); color: var(--gold-soft); }
.badge.contacted { background: rgba(132,176,255,0.16); color: #aecaff; }
.badge.replied   { background: rgba(132,176,255,0.16); color: #aecaff; }
.badge.done      { background: rgba(142,240,191,0.14); color: var(--success); }

/* Detail drawer (overlay panel) */
.drawer-backdrop {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(8,10,20,0.6); backdrop-filter: blur(3px);
}
.drawer-backdrop.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(460px, 92vw); transform: translateX(100%);
  transition: transform 0.25s ease;
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
  border-left: 1px solid var(--indigo-line);
  padding: 28px 26px; overflow-y: auto;
}
.drawer.show { transform: translateX(0); }
.drawer h2 { font-family: "Cormorant Garamond", serif; color: var(--gold-soft); font-size: 1.7rem; margin: 0 0 4px; }
.drawer .close {
  position: absolute; top: 18px; right: 20px; cursor: pointer; border: none; background: none;
  color: var(--text-dim); font-size: 1.6rem; line-height: 1;
}
.detail-row { padding: 11px 0; border-bottom: 1px solid var(--indigo-line); }
.detail-row .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); margin-bottom: 3px; }
.detail-row .v { color: var(--text); font-size: 0.98rem; word-break: break-word; }
.detail-row .v.muted { color: var(--text-dim); font-style: italic; }

/* Responsive */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  nav.menu { gap: 16px; }
  .hero { padding: 60px 0 50px; }
  table.data th:nth-child(3), table.data td:nth-child(3) { display: none; } /* hide place on small screens */
}
