:root {
  --color-bg: #0a0a0c;
  --color-surface: #121217;
  --color-surface-2: #17171d;
  --color-border: #25252d;
  --color-border-strong: #343440;
  --color-text: #f5f7fb;
  --color-text-muted: #9ca3af;
  --color-primary: #6366f1;
  --color-primary-hover: #7477f5;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-success-border: rgba(34, 197, 94, 0.24);
  --color-success-text: #bbf7d0;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.24);
  --color-error-text: #fecaca;
  --radius-sm: 10px;
  --radius-md: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --max-width: 1120px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

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

.id-header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(10px);
}

.id-header-inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: auto;
  height: 36px;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 24px;
}

.top-nav a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.top-nav a:hover {
  color: var(--color-text);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.auth-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-intro {
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-intro h1 {
  font-size: clamp(2rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

.alert {
  margin-bottom: 18px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.alert.success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.alert.error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

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

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

.field label {
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 14px 15px;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: var(--color-text-muted);
}

.field input:hover {
  border-color: var(--color-border-strong);
}

.field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.auth-switch {
  margin-top: 22px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-switch a {
  color: var(--color-text);
  font-weight: 600;
}

.auth-switch a:hover {
  color: var(--color-primary);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 22px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-hint-link {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.field-hint-link:hover {
  color: var(--color-primary);
}

.btn.is-loading {
  position: relative;
  color: transparent;
}

.btn.is-loading .btn-label {
  color: transparent;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

@media (max-width: 640px) {
  .id-header-inner {
    padding: 16px 18px;
  }

  .top-nav {
    gap: 16px;
  }

  .top-nav a {
    font-size: 0.9rem;
  }

  .auth-main {
    padding: 28px 16px;
  }

  .auth-card {
    padding: 24px;
  }
}

@media (max-width: 420px) {
  .brand span {
    font-size: 0.95rem;
  }

  .top-nav a {
    font-size: 0.88rem;
  }

  .auth-intro h1 {
    font-size: 1.85rem;
  }
}