:root {
  --bg-0: #0f1411;
  --bg-1: #142019;
  --accent-0: #f2c94c;
  --accent-1: #56ccf2;
  --accent-2: #6fcf97;
  --ink-0: #f5f7f4;
  --ink-1: #d7ddd6;
  --ink-2: #9aa59c;
  --line: rgba(255, 255, 255, 0.08);
}

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

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(1200px 900px at 20% -10%, #1f2f27 0%, var(--bg-0) 60%),
              radial-gradient(900px 700px at 90% 10%, #2a3b31 0%, var(--bg-0) 55%);
  color: var(--ink-0);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 6vw 48px;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.login-shell.enter {
  animation: slideInLeft 0.5s ease;
}

.login-shell.exit-left {
  transform: translateX(-40px);
  opacity: 0;
}

.login-shell.exit-right {
  transform: translateX(40px);
  opacity: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(300px 300px at 15% 20%, rgba(86, 204, 242, 0.12), transparent 60%),
              radial-gradient(260px 260px at 85% 30%, rgba(111, 207, 151, 0.12), transparent 65%);
  pointer-events: none;
}

.login-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.header-link {
  color: var(--ink-2);
  font-size: 14px;
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(15, 20, 17, 0.75);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.login-intro p {
  margin: 0 0 24px;
  color: var(--ink-1);
}

.alert {
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
}

.alert.error {
  background: rgba(210, 80, 80, 0.15);
  border: 1px solid rgba(210, 80, 80, 0.4);
}

.alert.success {
  background: rgba(111, 207, 151, 0.15);
  border: 1px solid rgba(111, 207, 151, 0.4);
}

.login-form {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

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

label {
  color: var(--ink-2);
  font-size: 13px;
}

input {
  background: rgba(12, 16, 14, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-0);
  font-size: 14px;
}

.helper {
  font-size: 12px;
  color: rgba(195, 212, 198, 0.8);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 13px;
}

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

.small-link {
  color: var(--ink-2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-0), #f2a74c);
  color: #1b221e;
}

.btn-loader {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(27, 34, 30, 0.35);
  border-top-color: #1b221e;
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .btn-text {
  opacity: 0.7;
}

.btn.is-loading .btn-loader {
  display: inline-block;
}

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

@media (max-width: 720px) {
  .login-card {
    padding: 22px;
  }
  .form-actions {
    justify-content: stretch;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
