/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #1a1d23;
  color: #c8ccd4;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Container ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: #23272e;
  border: 1px solid #2e333b;
  border-radius: 8px;
  padding: 40px 32px 32px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ── Header ──────────────────────────────────────────────── */
.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.lock-icon {
  width: 36px;
  height: 36px;
  color: #5c9eff;
  margin-bottom: 16px;
}

.card-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #e1e4ea;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 400;
}

/* ── Form Fields ─────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #e1e4ea;
  background: #1a1d23;
  border: 1px solid #363b44;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #4b5563;
}

.field input:focus {
  border-color: #5c9eff;
  box-shadow: 0 0 0 3px rgba(92, 158, 255, 0.12);
}

/* ── Submit Button ───────────────────────────────────────── */
button[type="submit"] {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  letter-spacing: 0.02em;
}

button[type="submit"]:hover:not(:disabled) {
  background: #2563eb;
}

button[type="submit"]:active:not(:disabled) {
  background: #1d4ed8;
}

button[type="submit"]:disabled {
  background: #2a3040;
  color: #4b5563;
  cursor: not-allowed;
}

/* ── Error Message ───────────────────────────────────────── */
.error-msg {
  margin-top: 18px;
  padding: 0;
  font-size: 0.84rem;
  color: #ef4444;
  text-align: center;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.error-msg.visible {
  opacity: 1;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.72rem;
  color: #4b5563;
  letter-spacing: 0.04em;
}

.footer-lock {
  font-size: 0.68rem;
  margin-right: 2px;
}

/* ── Loading Spinner on Button ───────────────────────────── */
button[type="submit"].loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

button[type="submit"].loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 440px) {
  .card {
    padding: 32px 20px 24px;
  }
}
