/* ============================================================
   bewerbungsguide.ch — shared UI base
   ============================================================ */

/* Design tokens */
:root {
  /* === Primary palette === */
  --navy:       #0f2744;
  --navy-mid:   #1a3a6b;
  --navy-lite:  #2563a8;
  --teal:       #0e7a6e;
  --teal-pale:  #e0f4f1;
  --surface:    #ffffff;
  --surface-2:  #f5f7fb;
  --surface-3:  #eaeff7;
  --blue-pale:  #e8f0fb;
  --blue-pale2: #d3e3f7;
  --ink:        #0f1a2e;
  --ink-muted:  #4a5e7a;
  --ink-faint:  #8899b2;
  --border:     rgba(15,39,68,0.10);
  --border-mid: rgba(15,39,68,0.18);
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  /* Backward-compat aliases */
  --white:      var(--surface);
  --paper:      var(--surface-2);
  --paper-2:    var(--surface-2);
  --paper-3:    var(--surface-3);
  --text:       var(--ink);
  --text-2:     var(--ink-muted);
  --text-3:     var(--ink-faint);
  --anthracite: var(--navy);
  --anth-2:     var(--navy-mid);
  --border-2:   var(--border-mid);
  --lime:       #C6F54A;
  --lime-muted: #e8fbbd;
  --lime-dark:  #3a5800;
  --f-head: 'Archivo', system-ui, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, sans-serif;
  --radius-sm: var(--r-sm);
  --radius:    var(--r-md);
  --radius-lg: var(--r-lg);
  --shadow-xs: 0 1px 2px rgba(15,39,68,.06);
  --shadow-sm: 0 1px 4px rgba(15,39,68,.08), 0 1px 2px rgba(15,39,68,.04);
  --shadow:    0 4px 16px rgba(15,39,68,.10), 0 1px 4px rgba(15,39,68,.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--f-body);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Navbar
   ============================================================ */

.bg-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  height: 52px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.bg-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0 1.5rem;
}

.bg-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--navy);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: -0.03em;
  padding-right: 1.5rem;
}

.bg-nav-brand .brand-w-main {
  font-weight: 300;
}

.bg-nav-brand .brand-w-bold {
  font-weight: 700;
}

.bg-nav-brand .brand-w-domain {
  font-weight: 300;
  opacity: 1;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: -0.02em;
}

.bg-nav-brand .brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  padding-left: 0.5rem;
}

.bg-nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color .12s;
}

.bg-nav-link:hover {
  color: var(--ink);
}

.bg-nav-link.active {
  color: var(--navy);
}

.bg-nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.bg-login-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  transition: color .12s, border-color .12s;
}

.bg-login-link:hover {
  color: var(--navy);
  border-color: var(--ink-muted);
}

/* ============================================================
   Profile avatar / dropdown
   ============================================================ */

.bg-profile-wrap {
  position: relative;
}

.bg-profile-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--surface);
  font-family: var(--f-head);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s;
}

.bg-profile-btn:hover {
  opacity: 0.88;
}

.bg-profile-btn:focus-visible {
  outline: 2px solid var(--navy-lite);
  outline-offset: 2px;
}

.bg-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}

.bg-profile-menu[hidden] {
  display: none;
}

.bg-menu-user {
  padding: 12px 16px 8px;
  font-size: 12px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .1s;
}

.bg-menu-item:hover {
  background: var(--surface-2);
}

button.bg-menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
}

.bg-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.bg-menu-logout {
  color: #b91c1c;
}

/* ============================================================
   Footer
   ============================================================ */

.bg-footer {
  background: var(--navy);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bg-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bg-footer-brand {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--surface);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.bg-footer-brand .fw-light {
  font-weight: 300;
}

.bg-footer-brand .fw-bold {
  font-weight: 700;
}

.bg-footer-brand .fw-domain { color: rgba(255,255,255,0.35); font-weight: 400; }

.bg-footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.bg-footer-link {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.30);
  text-decoration: none;
  transition: color .12s;
}

.bg-footer-link:hover {
  color: rgba(255,255,255,0.65);
}

.bg-footer-note {
  font-size: 11px;
  color: rgba(255,255,255,0.20);
  margin-top: 0.25rem;
}

/* ============================================================
   Page container utilities
   ============================================================ */

.bg-page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.bg-page-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.bg-section {
  padding: 3rem 0;
}

/* ============================================================
   Button utilities
   ============================================================ */

.bg-btn-primary {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--navy);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .12s, border-color .12s;
}

.bg-btn-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
}

.bg-btn-secondary {
  background: transparent;
  color: var(--anthracite);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--anthracite);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .12s;
}

.bg-btn-secondary:hover {
  background: var(--paper-2);
}

.bg-btn-lime {
  background: var(--lime);
  color: var(--lime-dark);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid var(--lime);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .12s, border-color .12s;
}

.bg-btn-lime:hover {
  background: #b8e83a;
  border-color: #b8e83a;
}

/* ============================================================
   Card
   ============================================================ */

.bg-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

/* ============================================================
   Auth state cards
   ============================================================ */

.bg-auth-state {
  padding: 3rem;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bg-auth-email {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.bg-auth-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Profile page
   ============================================================ */

.bg-profile-section {
  margin-bottom: 2rem;
}

.bg-profile-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.bg-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.bg-quick-link {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color .12s, box-shadow .12s;
}

.bg-quick-link:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   Typography utilities
   ============================================================ */

.bg-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.bg-page-title {
  font-family: var(--f-head);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.bg-page-lead {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ============================================================
   Auth loading state
   ============================================================ */

.bg-auth-loading {
  opacity: 0;
  animation: fadeIn 0.2s ease 0.1s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   Page header (legal / static pages)
   ============================================================ */

.bg-page-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2.5rem;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .bg-nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .bg-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .bg-page-wrap {
    padding: 2rem 1.25rem;
  }
}
