:root {
  color-scheme: dark;
  --text: #f3f6fa;
  --line: rgba(151, 172, 198, 0.15);
  --accent: #73c9ed;
  --error: #ff9292;
  font-family: Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(50, 126, 168, 0.12), transparent 32rem),
    linear-gradient(145deg, #060a10, #0a121d 58%, #060b12);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(135, 166, 193, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135, 166, 193, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

button,
input { font: inherit; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 1.25rem;
  place-items: center;
}

.login-panel {
  width: min(100%, 24rem);
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(18, 30, 46, 0.9), rgba(10, 20, 33, 0.82));
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px);
}

h1 {
  margin: 0 0 2rem;
  font-size: 1.65rem;
  font-weight: 560;
  letter-spacing: -0.035em;
}

.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;
}

.field + .field { margin-top: 0.9rem; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 1rem;
  width: 1.05rem;
  color: #68798d;
}

input {
  width: 100%;
  height: 3.2rem;
  padding: 0 3rem 0 2.85rem;
  color: var(--text);
  caret-color: var(--accent);
  outline: 0;
  border: 1px solid rgba(148, 174, 204, 0.16);
  border-radius: 0.6rem;
  background: rgba(3, 10, 18, 0.5);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder { color: #66778b; }
input:hover { border-color: rgba(148, 190, 221, 0.3); }

input:focus {
  border-color: rgba(115, 201, 237, 0.68);
  background: rgba(4, 14, 24, 0.7);
  box-shadow: 0 0 0 3px rgba(115, 201, 237, 0.09);
}

.reveal {
  position: absolute;
  right: 0.55rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  place-items: center;
  color: #6c7e92;
  cursor: pointer;
  outline: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
}

.reveal:hover,
.reveal:focus-visible { color: var(--accent); background: rgba(115, 201, 237, 0.07); }

.reveal svg { width: 1.15rem; }

.form-message {
  min-height: 2.9rem;
  margin-top: 0.75rem;
  padding: 0.72rem 0;
  color: transparent;
  font-size: 0.78rem;
}

.form-message.visible { color: var(--error); }

.submit-button {
  display: flex;
  width: 100%;
  height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #06121b;
  cursor: pointer;
  outline: 0;
  border: 0;
  border-radius: 0.6rem;
  background: linear-gradient(110deg, #8edcf5, #55bce4);
  box-shadow: 0 0.75rem 2rem rgba(37, 151, 201, 0.18);
  font-size: 0.86rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.submit-button:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 0.9rem 2.3rem rgba(37, 151, 201, 0.25); }
.submit-button:active { transform: translateY(0); }
.submit-button:focus-visible { box-shadow: 0 0 0 3px rgba(115, 201, 237, 0.22); }
.submit-button:disabled { cursor: wait; filter: saturate(0.7); transform: none; }

.spinner {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(6, 18, 27, 0.26);
  border-top-color: #06121b;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.submit-button.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 430px) {
  .shell { padding: 0.75rem; }
  .login-panel { padding: 2rem 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 1ms !important; }
}
