* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --primary: #337ab7;
  --primary-hover: #286090;
  --danger-bg: #fcf8e3;
  --danger-border: #faebcc;
  --danger-text: #8a6d3b;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.16);
}

html.theme-dark {
  color-scheme: dark;
  --bg: #111827;
  --panel: #1f2937;
  --text: #f9fafb;
  --muted: #cbd5e1;
  --border: #4b5563;
  --primary: #4f9ee8;
  --primary-hover: #73b7f1;
  --danger-bg: #3f3217;
  --danger-border: #8a6d3b;
  --danger-text: #f8d477;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 14px;
  line-height: 1.42857143;
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.theme-row {
  text-align: right;
}

.login-header {
  margin: 24px 0;
  border-bottom: 1px solid var(--border);
}

.login-logo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 22px;
}

.login-logo-client {
  width: 150px;
}

.login-logo-admin {
  width: 105px;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
}

.login-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 500;
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--danger-border);
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--danger-text);
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: bold;
}

.form-control {
  display: block;
  width: 100%;
  height: 38px;
  padding: 6px 12px;
  color: #555555;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  font-size: 14px;
  line-height: 1.42857143;
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #66afe9;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

html.theme-dark .form-control {
  color: #f9fafb;
  background-color: #111827;
  border-color: #4b5563;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 9px 12px;
  margin: 4px 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.42857143;
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  color: #ffffff;
  background: var(--primary);
  border-color: #2e6da4;
}

.btn-primary:hover,
.btn-primary:focus {
  color: #ffffff;
  background: var(--primary-hover);
  border-color: #204d74;
}

.version {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
}

.theme-slider {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.theme-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.theme-switch input:checked + .theme-slider {
  background: var(--primary);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(20px);
}

@media (max-width: 480px) {
  .login-shell {
    padding: 22px;
  }
}
