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

html {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: #09090b;
  background-image:
    radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

.container {
  width: 100%;
  max-width: 24rem;
}

.card {
  background-color: rgba(24, 24, 27, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(63, 63, 70, 0.5);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.25),
    0 8px 10px -6px rgba(0, 0, 0, 0.25);
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  height: 2.5rem;
  width: auto;
  margin-bottom: 1.5rem;
}

.title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fafafa;
  letter-spacing: -0.025em;
}

.subtitle {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #a1a1aa;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #d4d4d8;
}

.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #fafafa;
  background-color: rgba(9, 9, 11, 0.5);
  border: 1px solid #3f3f46;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: #52525b;
}

.input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background-color: #3b82f6;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn:hover {
  background-color: #2563eb;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.links {
  margin-top: 1.5rem;
  text-align: center;
}

.link {
  font-size: 0.875rem;
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.15s;
}

.link:hover {
  color: #60a5fa;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.message.error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.message.success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.message.info {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #3f3f46;
}

.error {
  text-align: center;
}

.error-code {
  font-size: 3rem;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 0.5rem;
}

.error-message {
  font-size: 1rem;
  color: #a1a1aa;
  margin-bottom: 1.5rem;
}

.password-toggle {
  position: absolute;
  right: 1px;
  bottom: 1px;
  height: calc(2.5rem - 2px);
  width: 2.5rem;
  background-color: transparent;
  border: none;
  border-radius: 0 0.5rem 0.5rem 0;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}

.password-toggle:hover svg {
  stroke: #fafafa;
}

.password-toggle:focus {
  outline: none;
}

.password-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: #a1a1aa;
  fill: none;
}

/* HTMX request indicators */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Disable button during request */
.btn.htmx-request {
  opacity: 0.7;
  cursor: wait;
}

/* Spinner animation */
.spinner {
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  animation: spin 1s linear infinite;
}

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

/* Hide button text during request, show spinner */
.btn-text {
  display: inline;
}

.htmx-request .btn-text {
  display: none;
}

.btn-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.htmx-request .btn-loading {
  display: inline-flex;
}
