:root {
  --bg: #060608;
  --surface: rgba(12, 12, 16, 0.97);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text-primary: #f0f0f4;
  --text-secondary: #8b8b9e;
  --text-muted: #52526a;
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.35);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 15%, transparent 72%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 10% 15%, rgba(59, 130, 246, 0.18), transparent 65%),
    radial-gradient(ellipse 45% 35% at 90% 80%, rgba(34, 197, 94, 0.08), transparent 65%);
}

.auth-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-float 8s ease-in-out infinite;
}

.auth-orb--1 {
  width: 280px;
  height: 280px;
  background: rgba(59, 130, 246, 0.12);
  top: 20%;
  left: -5%;
}

.auth-orb--2 {
  width: 220px;
  height: 220px;
  background: rgba(34, 197, 94, 0.08);
  bottom: 10%;
  right: -3%;
  animation-delay: -4s;
}

@keyframes orb-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20px, -16px) scale(1.06);
  }
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  gap: 20px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s var(--ease);
  animation: fade-up 0.5s var(--ease) both;
}

.auth-back svg {
  width: 16px;
  height: 16px;
}

.auth-back:hover {
  color: var(--text-primary);
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(12, 12, 16, 0.92);
  backdrop-filter: blur(20px);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.auth-card--enter {
  animation: card-enter 0.65s var(--ease) 0.1s both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card__chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.chrome-dots {
  display: flex;
  gap: 5px;
}

.chrome-dots span:nth-child(1) {
  background: #ff5f57;
}
.chrome-dots span:nth-child(2) {
  background: #ffbd2e;
}
.chrome-dots span:nth-child(3) {
  background: #28c840;
}

.chrome-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chrome-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.auth-card__body {
  padding: 24px;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-header__text {
  flex: 1;
  min-width: 0;
}

/* auth-theme-toggle: header-theme-btn stílus a styles.css-ben */

.auth-logo {
  border-radius: 10px;
  object-fit: cover;
}

.auth-header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.auth-tab {
  position: relative;
  z-index: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.25s var(--ease);
}

.auth-tab.active {
  color: var(--text-primary);
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}

.auth-tabs[data-mode="signup"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
  position: absolute;
  width: calc(100% - 48px);
  visibility: hidden;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    visibility 0.3s;
}

.auth-form--active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  width: 100%;
  visibility: visible;
}

.auth-form--exit-left {
  transform: translateX(-16px);
  opacity: 0;
}

.auth-form--enter-right {
  animation: form-enter 0.35s var(--ease) both;
}

@keyframes form-enter {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-card__body {
  position: relative;
  min-height: 460px;
}

.auth-credentials {
  position: relative;
  min-height: 280px;
}

.auth-credentials .auth-form {
  width: 100%;
}

.auth-google {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 4px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.auth-google:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.auth-google:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-google__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-google__loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-google.is-loading .auth-google__text {
  visibility: hidden;
}

.auth-google.is-loading .auth-google__loader {
  display: block;
  position: absolute;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-divider--compact {
  margin: 4px 0 2px;
}

.auth-email-link-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.auth-submit--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.auth-submit--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.auth-email-link-panel[hidden],
#authMainFlow[hidden] {
  display: none !important;
}

.auth-email-link-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-email-link-panel__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-email-link-panel__lead {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.auth-login-mode {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  margin-bottom: 2px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.auth-login-mode__indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-hover);
  border-radius: 5px;
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}

.auth-login-mode[data-mode="link"] .auth-login-mode__indicator {
  transform: translateX(100%);
}

.auth-login-mode__btn {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.auth-login-mode__btn.active {
  color: var(--text-primary);
}

.auth-login-panels {
  position: relative;
  min-height: 11.75rem;
}

.auth-login-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100%;
  visibility: hidden;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    visibility 0.3s;
}

.auth-login-section--active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  visibility: visible;
}

.auth-login-section--enter {
  animation: form-enter 0.35s var(--ease) both;
}

.auth-login-section--exit-left {
  transform: translateX(-16px);
  opacity: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 18px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-field-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  margin-bottom: 2px;
}

.auth-forgot {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease);
}

.auth-forgot:hover {
  color: var(--accent);
}

.auth-forgot:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-success {
  font-size: 13px;
  color: #86efac;
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.45;
}

.auth-error {
  font-size: 13px;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

.auth-submit {
  position: relative;
  margin-top: 4px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    opacity 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-submit__loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.auth-submit.is-loading .auth-submit__text {
  visibility: hidden;
}

.auth-submit.is-loading .auth-submit__loader {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-card--success {
  animation: success-pulse 0.5s var(--ease);
}

@keyframes success-pulse {
  0% {
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 32px 64px rgba(0, 0, 0, 0.5),
      0 0 40px rgba(34, 197, 94, 0.25);
  }
  100% {
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  }
}

.auth-footer-note {
  max-width: 420px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  animation: fade-up 0.5s var(--ease) 0.25s both;
}

@media (max-width: 480px) {
  .auth-card__body {
    padding: 20px;
  }

  .auth-form {
    width: calc(100% - 40px);
  }
}
