/* Header with account area */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { text-decoration: none; }

#account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.who { font-weight: 600; }

.badge {
  background: var(--surface-2);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

.nav-btn {
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: var(--grad);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-btn.light {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

/* Login, sign up and profile pages */
.auth-page { padding: 0 16px; }

.auth-card {
  background: var(--surface);
  max-width: 420px;
  margin: 40px auto;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.auth-card [hidden] { display: none !important; }

.auth-card h2 { font-size: 1.3rem; margin-bottom: 6px; }

.auth-card .row { display: flex; gap: 8px; }

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.auth-card textarea { resize: vertical; }

.auth-card form button {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-card form button:disabled { opacity: 0.6; cursor: wait; }

.note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

#msg { margin-top: 14px; font-size: 0.9rem; text-align: center; }
#msg.error { color: var(--danger); }
#msg.ok { color: var(--success); }

/* Info pages: about and contact */
.page {
  max-width: 760px;
  margin: 32px auto 8px;
  padding: 0 16px;
}

.page h1 { font-size: 2rem; margin-bottom: 8px; }

.page .lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 16px;
}

.box h2 { font-size: 1.25rem; margin-bottom: 8px; }
.box p { line-height: 1.55; margin-bottom: 8px; }
.box ul,
.box ol { margin: 6px 0 0 20px; line-height: 1.7; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.info-card [hidden] { display: none !important; }
.info-card .k { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.info-card a,
.info-card .v { font-weight: 600; color: var(--text); text-decoration: none; word-break: break-word; }

.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

details { border-top: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 8px; color: var(--muted); line-height: 1.55; }

/* Footer */
.site-footer {
  margin-top: 48px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 20px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
}

.f-logo {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.f-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
  line-height: 1.5;
}

.f-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.f-col a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 4px 0;
  word-break: break-word;
}

.f-col a:hover { color: var(--accent); }

.f-bottom {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Theme switch in the footer */
.theme-switch { display: flex; align-items: center; gap: 8px; }

.theme-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 5px 11px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: -1px;
}
.theme-btn:first-of-type { border-radius: 8px 0 0 8px; margin-left: 0; }
.theme-btn:last-of-type { border-radius: 0 8px 8px 0; }
.theme-btn.on {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* Colors of page-specific styles. The html prefix makes these win over the
   small style blocks inside individual pages, so every page follows the theme. */
html .login-card {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 16px 40px var(--shadow-color);
}
html .seg { background: var(--surface-2); }
html .seg .tab.on { background: var(--surface); color: var(--text); }
html .field input,
html .field select {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
html .field input.bad,
html .field select.bad { border-color: var(--danger); }
html .err { color: var(--danger); }
html #pwHint.ok { color: var(--success); }
html .form-panel #msg.error { background: var(--danger-bg); color: var(--danger); }
html .form-panel #msg.ok { background: var(--success-bg); color: var(--success); }

html .facts { background: var(--surface-3); border-color: var(--line); }
html #applyMsg.error { color: var(--danger); }
html #applyMsg.ok { color: var(--success); }
html .app .saved,
html #saved { color: var(--success); }

html #withdrawBtn,
html .auth-card form button.ghost,
html .small-btn {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

html .auth-card form .chip {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
html .auth-card form .chip.on {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

html .app-link:hover { background: var(--surface-3); }

/* Card photos are soft colors, so they are dimmed a little in dark mode */
html .job-photo { filter: var(--photo-filter); }

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .f-brand { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .who,
  .badge { display: none; }
}