@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600;700&display=swap');

:root {
  --bg: #e9eef4;
  --surface: #f7f9fc;
  --surface-alt: #edf1f6;
  --border: #cfd7e3;
  --text: #1b2533;
  --muted: #4a5565;
  --accent: #0f4a7f;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.theme-dark {
  color-scheme: dark;
  --bg: #0f1722;
  --surface: #15202c;
  --surface-alt: #1b2734;
  --border: #2a3846;
  --text: #e4e9f0;
  --muted: #a2adbb;
  --accent: #5b8db8;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

a {
  color: inherit;
  text-decoration: none;
}

.public-header {
  background: rgba(233, 238, 244, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 0;
}

.brand-mark img {
  height: 16px;
  width: auto;
  display: block;
}

.brand-text {
  font-size: 16px;
}

.public-nav {
  display: flex;
  gap: 14px;
  font-weight: 600;
  color: var(--muted);
}

.nav-link {
  color: var(--muted);
}

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle:hover {
  background: var(--surface-alt);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(15, 74, 127, 0.35);
  outline-offset: 2px;
}

.theme-toggle .icon-sun {
  display: inline;
}

.theme-toggle .icon-moon {
  display: none;
}

.language-form {
  margin: 0;
}

.language-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  height: 38px;
  min-width: 0;
  width: auto;
  padding: 0 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.language-select:focus-visible {
  outline: 2px solid rgba(15, 74, 127, 0.35);
  outline-offset: 2px;
}

body.theme-dark .public-header {
  background: var(--surface);
  border-color: var(--border);
}

body.theme-dark .auth-card,
body.theme-dark .auth-copy {
  color: var(--text);
}

body.theme-dark .auth-card {
  background: var(--surface);
  border-color: var(--border);
}

body.theme-dark input {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
}

body.theme-dark .theme-toggle {
  background: #1b2734;
  border-color: #2a3846;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

body.theme-dark .theme-toggle:hover {
  background: #223244;
}

body.theme-dark .theme-toggle:focus-visible {
  outline-color: rgba(91, 141, 184, 0.5);
}

body.theme-dark .theme-toggle .icon-sun {
  display: none;
}

body.theme-dark .theme-toggle .icon-moon {
  display: inline;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-ghost {
  background: var(--surface-alt);
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(340px, 0.9fr);
  gap: 24px;
  padding: 36px 28px 48px;
  min-height: calc(100vh - 74px);
  max-width: 1180px;
  margin: 0 auto;
  align-items: stretch;
}

.auth-copy {
  background: linear-gradient(145deg, rgba(15, 74, 127, 0.1), var(--surface));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.auth-copy h1 {
  margin: 0;
  font-size: 32px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.auth-card h2 {
  margin: 0;
  font-size: 20px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-card input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-family: inherit;
}

.auth-helper {
  font-size: 13px;
  color: var(--muted);
}

.error {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-weight: 600;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .public-nav {
    display: none;
  }

  .auth-page {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 16px 32px;
  }

  .auth-copy,
  .auth-card {
    border-radius: 14px;
    padding: 18px;
  }
}

.footer {
  background: #101826;
  color: #d4dbe4;
  padding: 40px 28px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.footer a {
  color: #c6d2e3;
  display: block;
  margin-top: 6px;
}

.footer .socials {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
}
