:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #0b0e13;
  color: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(70, 100, 190, 0.22), transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(58, 151, 113, 0.16), transparent 32%),
    #0b0e13;
}

button,
input,
select {
  font: inherit;
}

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

.card {
  width: min(680px, 100%);
  background: rgba(18, 23, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

[hidden] {
  display: none !important;
}

.login-card {
  width: min(500px, 100%);
}

.login-key-label {
  margin-top: 16px;
}

.login-button {
  width: 100%;
  margin-top: 18px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: #aeb7c6;
  font-size: 0.86rem;
}

.remember-row input {
  width: auto;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: #8ba5ff;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -0.05em;
}

.subtitle {
  color: #aeb7c6;
  line-height: 1.55;
  margin: 12px 0 24px;
}

#appPanel > header {
  position: relative;
  margin-bottom: 24px;
  padding-right: 76px;
}

.logout-button {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.75rem;
}

.parking-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.parking-config label,
.place-manager label,
.extension-grid span {
  display: block;
  color: #8f9aac;
  font-size: 0.8rem;
  font-weight: 700;
}

.parking-config label,
.place-manager label {
  display: grid;
  gap: 7px;
}

.place-manager {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.place-picker {
  display: flex;
  align-items: end;
  gap: 10px;
}

.place-picker > label {
  flex: 1 1 auto;
  min-width: 0;
}

.place-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.place-form[hidden] {
  display: none;
}

.place-form h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.place-form > label {
  display: block;
  margin-bottom: 12px;
}

.place-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.place-actions #placeCount {
  margin-left: auto;
  color: #818da0;
  font-size: 0.78rem;
}

.add-place-button {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  color: #07150e;
  background: #56c489;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.add-place-button:hover:not(:disabled) {
  background: #6ed39c;
}

.add-place-button.is-open span {
  transform: rotate(45deg);
}

.add-place-button span {
  transition: transform 0.18s ease;
}

.message.compact {
  margin-top: 8px;
  min-height: 0;
  font-size: 0.82rem;
}

.license-config {
  grid-template-columns: 1fr;
  margin-bottom: 24px;
}

.token-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.token-note {
  color: #818da0;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 8px 0 0;
}

code {
  color: #aebeff;
}

input,
select {
  width: 100%;
  min-width: 0;
  color: #fff;
  background: #0e131c;
  border: 1px solid #303949;
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #7892ed;
  box-shadow: 0 0 0 3px rgba(120, 146, 237, 0.16);
}

.status-panel {
  margin-top: 20px;
  background: #101620;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 17px;
  padding: 20px;
}

.status-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.idle,
.badge.auto-off {
  color: #aeb7c6;
  background: #232a36;
}

.badge.active,
.badge.auto-on {
  color: #a8f4c8;
  background: rgba(44, 151, 94, 0.18);
}

.badge.expired {
  color: #ffd59a;
  background: rgba(214, 128, 38, 0.18);
}

.badge.busy {
  color: #c8d4ff;
  background: rgba(83, 112, 219, 0.2);
}

.badge.auto-failed {
  color: #ffb4b4;
  background: rgba(203, 65, 65, 0.2);
}

#parkingId {
  color: #8894a7;
  font-size: 0.83rem;
  text-align: right;
}

.countdown {
  margin-top: 18px;
  font-size: clamp(3rem, 13vw, 5.8rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
}

.end-time {
  color: #9ca8ba;
  margin-top: 8px;
}

.progress-track {
  height: 7px;
  margin: 20px 0;
  background: #252d3a;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #647fed, #56c489);
  transition: width 0.35s ease;
}

.extension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.extension-grid div {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  padding: 12px;
}

.extension-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.stop-reason {
  margin: 14px 0 0;
  border: 1px solid rgba(214, 128, 38, 0.3);
  border-radius: 12px;
  background: rgba(214, 128, 38, 0.1);
  color: #ffd59a;
  padding: 11px 12px;
  line-height: 1.45;
}

.stop-reason.failure {
  border-color: rgba(225, 83, 83, 0.35);
  background: rgba(225, 83, 83, 0.1);
  color: #ffb4b4;
}

.message {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: #c7cfdb;
  line-height: 1.45;
}

.message.error {
  color: #ffaaaa;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary {
  background: #6f89eb;
  color: #08101f;
}

.secondary {
  background: #252d39;
  color: #dbe2ec;
}

.danger {
  background: #c84f58;
  color: #180508;
}

.small {
  padding-inline: 14px;
}

@media (max-width: 560px) {
  .card {
    padding: 22px;
    border-radius: 18px;
  }

  .parking-config,
  .extension-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .place-actions #placeCount {
    width: 100%;
    margin-left: 0;
  }

  .full-width {
    grid-column: auto;
  }

  .status-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  #parkingId {
    text-align: left;
  }
}
