*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #1a3a5c;
  --brand-light: #265a8a;
  --brand-pale:  #eef3f8;
  --danger:      #c0392b;
  --success-bg:  #e8f5e9;
  --success-text:#1b5e20;
  --success-bdr: #c3e6cb;
  --error-bg:    #fdecea;
  --error-text:  #b71c1c;
  --error-bdr:   #f5c6c6;
  --border:      #e0e0e0;
  --muted:       #888;
  --radius:      8px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f6f8;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ─── Global Nav ─────────────────────────────────────────────── */
.site-header {
  background: var(--brand);
  color: #fff;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 2rem;
}

.site-header .logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.site-nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ─── Avatar / user menu ─────────────────────────────────────── */
.user-menu-wrap {
  position: relative;
  margin-left: auto;
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}
.avatar-btn:hover { background: rgba(255,255,255,0.3); }

.avatar-btn.guest {
  font-size: 1rem;
  background: rgba(255,255,255,0.15);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 180px;
  overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dropdown .dd-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.user-dropdown .dd-header strong {
  display: block;
  color: #1a1a1a;
  font-size: 0.92rem;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: transparent;
  border: none;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
}
.user-dropdown a:hover,
.user-dropdown button:hover { background: var(--brand-pale); }
.user-dropdown .dd-logout { color: var(--danger); border-top: 1px solid var(--border); }

/* ─── Page wrapper ───────────────────────────────────────────── */
.page-body { padding: 2.5rem 2rem; max-width: 960px; margin: 0 auto; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--brand);
  color: #fff;
  padding: 4rem 2rem;
  text-align: center;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 0.75rem; }
.hero p  { font-size: 1.1rem; opacity: 0.85; max-width: 540px; margin: 0 auto 1.75rem; }
.hero .cta-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #fff;
  color: var(--brand);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.hero .cta-btn:hover { background: #e8f0f8; }

/* ─── Cards grid ─────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--brand); }
.card p  { font-size: 0.9rem; color: #555; line-height: 1.6; }

/* ─── Section headings ───────────────────────────────────────── */
.section-title { font-size: 1.5rem; color: var(--brand); margin-bottom: 0.5rem; }
.section-sub   { color: var(--muted); margin-bottom: 2rem; font-size: 0.95rem; }

/* ─── Forms (contact, auth) ──────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  max-width: 520px;
}
.field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.field label { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; color: #333; }
.field small  { font-weight: 400; color: var(--muted); }

input, textarea, select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }

button {
  padding: 0.55rem 1.25rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background 0.15s;
}
button:hover    { background: var(--brand-light); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 0.65rem 1rem; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 1rem; }
.alert-error   { background: var(--error-bg);   color: var(--error-text);   border: 1px solid var(--error-bdr); }
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-bdr); }

/* ─── Table (users admin) ────────────────────────────────────── */
#user-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
#user-form input { flex: 1; min-width: 160px; width: auto; }
#user-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
#user-list li {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center;
}
.delete-btn { background: var(--danger); padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.delete-btn:hover { background: #e74c3c; }

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
