:root{
  --nav-size: 72px;

  /* NEW: topbar height */
  --topbar-height: 64px;

  /* Core colors */
  --bg: #f3f7f2;         /* slight green-tinted background */
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;

  /* Brand (Minecraft green) */
  --primary: #22c55e;                   /* green */
  --primary-soft: rgba(34,197,94,.14);  /* soft green */
  --primary-ring: rgba(34,197,94,.18);  /* focus ring green */

  /* UI */
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

/* App layout */
.app-shell{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* UPDATED: content now needs top padding (not bottom) */
.app-content{
  flex: 1;
  padding: 20px;
  padding-top: calc(var(--topbar-height) + 20px);
}

.page-card{
  max-width: 980px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.page-title{
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.page-subtitle{
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ===============================
   NEW TOP NAV + MOBILE DRAWER
   =============================== */

.app-topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.topbar-inner{
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-brand{
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .2px;
}

.topbar-links{
  display: none; /* shown on desktop via media query */
  align-items: center;
  gap: 8px;
}

.topbar-link{
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .15s ease, color .15s ease;
}

.topbar-link:hover{
  background: var(--primary-soft);
  color: var(--primary);
}

.topbar-link.active{
  background: var(--primary-soft);
  color: var(--primary);
}

/* Hamburger button */
.nav-toggle{
  height: 42px;
  width: 46px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .08s ease;
}

.nav-toggle:hover{
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

.nav-toggle:active{
  transform: translateY(1px);
}

.nav-toggle:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

/* 3 lines */
.nav-toggle-lines{
  width: 18px;
  height: 12px;
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.nav-toggle-lines::before{
  top: 0;
  box-shadow: 0 5px 0 var(--text), 0 10px 0 var(--text);
}

/* Overlay */
.nav-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 999;
}

/* Drawer */
.nav-drawer{
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  left: auto;
  width: min(320px, 86vw);
  height: calc(100vh - var(--topbar-height));
  background: #ffffff;
  border-left: 1px solid var(--border);
  border-right: 0;
  transform: translateX(100%);
  transition: transform .2s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.nav-drawer-header{
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-drawer-title{
  font-weight: 800;
  color: var(--text);
}

.nav-drawer-close{
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 12px;
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.nav-drawer-links{
  padding: 10px;
  display: grid;
  gap: 8px;
}

.drawer-link{
  text-decoration: none;
  color: var(--muted);
  font-weight: 800;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.drawer-link:hover{
  background: var(--primary-soft);
  color: var(--primary);
}

.drawer-link.active{
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(34,197,94,.22); /* green border hint */
}

/* Open state */
body.nav-open .nav-overlay{
  opacity: 1;
  pointer-events: auto;
}

body.nav-open .nav-drawer{
  transform: translateX(0);
}

/* Desktop: show links, hide hamburger + drawer/overlay */
@media (min-width: 900px){
  .topbar-links{
    display: flex;
  }

  .nav-toggle{
    display: none;
  }

  .nav-drawer,
  .nav-overlay{
    display: none;
  }

  .app-content{
    padding-top: calc(var(--topbar-height) + 28px);
    padding-left: 28px;
    padding-right: 28px;
  }
}

/* ===============================
   AUTH + FORMS + ALERTS (login/newUser)
   =============================== */

/* Nicer defaults inside cards */
.page-card a{
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.page-card a:hover{
  text-decoration: underline;
}

/* Form layout */
.form-row{
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

/* Labels */
.label{
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

textarea{
  min-height: 110px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder{
  color: rgba(100,116,139,.85);
}

input:focus,
select:focus,
textarea:focus{
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

input:disabled,
select:disabled,
textarea:disabled{
  opacity: .65;
  cursor: not-allowed;
  background: rgba(255,255,255,.75);
}

/* Primary button */
.btn-primary{
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  color: #06210f;
  background: linear-gradient(180deg, rgba(34,197,94,1) 0%, rgba(22,163,74,1) 100%);
  box-shadow: 0 12px 22px rgba(34,197,94,.22);
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}

.btn-primary:hover{
  filter: brightness(1.02);
  box-shadow: 0 16px 26px rgba(34,197,94,.26);
}

.btn-primary:active{
  transform: translateY(1px);
  box-shadow: 0 10px 18px rgba(34,197,94,.20);
}

.btn-primary:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-ring), 0 16px 26px rgba(34,197,94,.22);
}

/* Helper text under buttons */
.helper-text{
  margin: 10px 0 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

/* Alerts */
.alert{
  border-radius: 14px;
  padding: 12px 12px;
  margin: 14px 0;
  border: 1px solid var(--border);
  background: #ffffff;
}

.alert-line{
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.alert-success{
  border-color: rgba(34,197,94,.30);
  background: rgba(34,197,94,.10);
}

.alert-success .alert-line,
.alert-success{
  color: #064e1f;
  font-weight: 700;
}

.alert-error{
  border-color: rgba(239,68,68,.30);
  background: rgba(239,68,68,.08);
}

.alert-error .alert-line{
  color: #7f1d1d;
  font-weight: 700;
}

/* Make forms feel less cramped on desktop */
@media (min-width: 720px){
  .page-card{
    padding: 28px;
  }
  .form-row{
    gap: 16px;
  }
}

/* Footer */
.pfooter{
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  margin: 18px 0 0 0;
}
/* Social links */
.social-links { display: inline-flex; gap: 8px; align-items: center; }
.social-links a { display: inline-block; line-height: 0; }
.social-links img { width: 48px; height: 48px; display: block; }

/* ===============================
   FORMS: stacks + two-col + checkboxes
   =============================== */

.form-stack{
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

/* Reuse your existing label style system */
.form-field{
  display: grid;
  gap: 6px;
}

.form-field .label{
  margin: 0;
}

/* Two-up row on desktop, single column on mobile */
.form-row.two-col{
  grid-template-columns: 1fr;
}

@media (min-width: 720px){
  .form-row.two-col{
    grid-template-columns: 1fr 1fr;
  }
}

/* Checkbox row */
.checkbox-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.checkbox-row input[type="checkbox"]{
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.checkbox-row .checkbox-text{
  font-weight: 800;
  color: var(--text);
  font-size: 14px;
}

/* Optional small helper text under a field */
.field-help{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}
