:root {
  --bg-deep: #0a0e18;
  --bg-panel: rgba(12, 18, 32, 0.88);
  --border-glow: rgba(90, 140, 255, 0.45);
  --accent: #5b8cff;
  --accent-hot: #7aa8ff;
  --gold: #e8c56a;
  --text: #eef3ff;
  --muted: #8fa3c8;
  --danger: #ff6b7a;
  --success: #5ddea0;
  --input-bg: rgba(8, 12, 24, 0.75);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg-deep);
}

body.auth-page {
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background: #0a0e18 center / cover no-repeat;
  z-index: 0;
}

.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(6, 10, 22, 0.92) 0%,
    rgba(10, 18, 40, 0.55) 45%,
    rgba(6, 10, 22, 0.88) 100%
  );
}

.auth-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 440px);
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  align-items: center;
}

.auth-brand {
  padding: 1rem 0;
}

.auth-brand img.logo {
  width: min(280px, 70vw);
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.6));
}

.auth-brand p.tagline {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 32rem;
  line-height: 1.6;
  margin-top: 1.25rem;
}

.auth-brand p.tagline i {
  color: var(--accent);
  margin-right: 0.35rem;
}

.auth-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-tabs button {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.auth-tabs button.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.18);
  box-shadow: 0 0 20px rgba(91, 140, 255, 0.2);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-form.active {
  display: flex;
}

.field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field label i {
  margin-right: 0.35rem;
  opacity: 0.85;
}

.field input,
.field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(120, 150, 200, 0.25);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2);
}

.field input::placeholder {
  color: rgba(143, 163, 200, 0.55);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-primary {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a72e8, #6b9aff);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 28px rgba(74, 114, 232, 0.45);
  transition: transform 0.15s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-message {
  min-height: 1.25rem;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--success);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }
  .auth-brand {
    text-align: center;
  }
  .auth-brand p.tagline {
    margin: 0 auto;
  }
}
