:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --line: #e3e7ee;
  --brand: #e0a526;
  --brand-dark: #b8830f;
  --nav: #151c2c;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(21, 28, 44, 0.08);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef1f6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

/* Auth pages */

.auth-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 165, 38, 0.16), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(21, 28, 44, 0.08), transparent 46%),
    var(--bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card-wide {
  max-width: 560px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: none;
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.brand-text p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.page-intro {
  margin: 24px 0 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.page-intro h2 {
  font-size: 18px;
  font-weight: 650;
}

.page-intro p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset + .fieldset {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

legend {
  margin-bottom: 12px;
  padding: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.driver-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field + .field {
  margin-top: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.field-row .field {
  margin-top: 0;
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d3d9e3;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select {
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224, 165, 38, 0.18);
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.alert {
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #fecdc9;
  border-radius: 8px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  color: #1b1403;
  background: var(--brand);
}

.btn-primary:hover:not(:disabled) {
  background: #eab43c;
}

.btn-primary:active:not(:disabled) {
  background: var(--brand-dark);
}

.btn-ghost {
  height: 34px;
  color: #e8ecf4;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  text-decoration: none;
}

.btn-secondary:hover {
  background: #f7f9fc;
  border-color: #cfd6e2;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Application shell */

.app-page {
  min-height: 100vh;
}

.topbar {
  background: var(--nav);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar .brand-logo {
  width: 38px;
  height: 38px;
}

.topbar .brand-text h1 {
  color: #fff;
  font-size: 18px;
}

.topbar .brand-text p {
  color: rgba(232, 236, 244, 0.62);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.who {
  font-size: 13px;
  color: rgba(232, 236, 244, 0.82);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.page-head h2 {
  font-size: 24px;
  font-weight: 700;
}

.page-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

.stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
}

.panel {
  margin-top: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
}

.panel h3 {
  font-size: 16px;
}

.panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  .card {
    padding: 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    padding: 12px 16px;
  }

  .container {
    padding: 24px 16px 48px;
  }
}
