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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #09090b;
  color: #fafafa;
  min-height: 100vh;
}

/* ── Layout ── */

.login-page {
  display: flex;
  min-height: 100vh;
}

.login-sidebar {
  width: 420px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #18181b 0%, #0c0c0e 100%);
  border-right: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.login-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(63, 63, 70, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 63, 70, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.sidebar-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #09090b;
}

/* ── Brand ── */

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  background: #fafafa;
  color: #09090b;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fafafa;
}

.brand-llc {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #71717a;
  margin-top: 0.125rem;
}

/* ── Sidebar Info ── */

.sidebar-info {
  flex: 1;
}

.sidebar-info h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.sidebar-info p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #a1a1aa;
  max-width: 320px;
}

.env-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #a1a1aa;
  border: 1px solid #27272a;
  background: rgba(39, 39, 42, 0.4);
}

/* ── Sidebar Footer ── */

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #71717a;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Login Form Area ── */

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.login-header {
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.login-header p {
  font-size: 0.9375rem;
  color: #71717a;
}

/* ── Form ── */

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8125rem 1rem 0.8125rem 2.75rem;
  background: #18181b;
  border: 1px solid #27272a;
  color: #fafafa;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

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

.input-wrapper input:focus {
  border-color: #fafafa;
  box-shadow: 0 0 0 1px #fafafa;
}

/* ── Submit Button ── */

.btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  background: #fafafa;
  color: #09090b;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-submit:hover {
  background: #d4d4d8;
}

.btn-submit:active {
  background: #a1a1aa;
}

/* ── Error ── */

.error-banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ── Authenticated State ── */

.auth-status {
  text-align: center;
}

.check-icon {
  margin-bottom: 1.5rem;
}

.auth-status h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: 0.5rem;
}

.auth-message {
  color: #71717a;
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.btn-outline {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  border: 1px solid #27272a;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-outline:hover {
  border-color: #fafafa;
  color: #fafafa;
}

/* ── Footer ── */

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #27272a;
}

.login-footer p {
  font-size: 0.75rem;
  color: #52525b;
  line-height: 1.5;
}

/* ── Responsive ── */

@media (max-width: 860px) {
  .login-page {
    flex-direction: column;
  }

  .login-sidebar {
    width: 100%;
    padding: 2rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid #27272a;
  }

  .sidebar-info {
    display: none;
  }

  .brand {
    margin-bottom: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .login-main {
    padding: 2rem 1.5rem;
  }
}
