.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100dvh - 11rem);
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.auth-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  max-width: 420px;
  width: 100%;
  padding: 2.5rem 2rem;
  animation: fadeInUp 0.4s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  margin: 0 auto 0.8rem;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 18%, transparent);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

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

.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.auth-social {
  margin-bottom: 1.25rem;
}

.auth-social-grid {
  display: grid;
  gap: 0.75rem;
}

.auth-card .auth-social-button {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.88rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, white);
  background-color: color-mix(in srgb, white 94%, var(--step-bg));
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 6%, transparent);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-card .auth-social-button:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background-color: color-mix(in srgb, white 88%, var(--primary) 12%);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 14%, transparent);
  transform: translateY(-1px);
}

.auth-card .auth-social-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 65%, white);
  outline-offset: 2px;
}

.auth-social-button-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-social-icon,
.auth-social-mark {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, white);
  color: var(--primary-hover);
}

.auth-social-icon i {
  font-size: 1rem;
  line-height: 1;
}

.auth-social-icon-google {
  background: linear-gradient(135deg, #ffffff 0%, #f7f8fb 100%);
  border: 1px solid color-mix(in srgb, var(--border) 70%, white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: #4285f4;
}

.auth-social-button-google:hover .auth-social-icon-google {
  color: #1a73e8;
}

.auth-divider {
  position: relative;
  margin: 1.2rem 0 1.45rem;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--border);
  transform: translateY(-50%);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.75rem;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.tab {
  background: none;
  border: none;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: color 0.2s ease, border-bottom 0.2s ease;
}

.tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.auth-input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 80%, transparent);
}

.auth-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 600;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 25%, transparent);
}

.is-hidden {
  display: none;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: var(--step-bg);
  color: var(--text);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, var(--border));
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 25%, var(--border));
}

.alert-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 25%, var(--border));
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-wrapper {
    min-height: calc(100dvh - 8.5rem);
    padding: 1.25rem 1rem;
  }
}

.auth-inline-state {
  margin-top: 0.9rem;
}

.auth-state-card {
  margin-top: 1rem;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.25rem 0 1rem;
}

.auth-link {
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-password-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}

.auth-input-password {
  margin-bottom: 0;
  padding-right: 3.5rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.95;
}

.auth-password-toggle:hover {
  color: var(--text, #111827);
}

.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
  border-radius: 6px;
}

.auth-password-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.auth-password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

.auth-password-toggle .icon-eye-off {
  display: none;
}

.auth-password-toggle.is-active .icon-eye {
  display: none;
}

.auth-password-toggle.is-active .icon-eye-off {
  display: block;
}
