/* ========== Auth pages (login / register) ========== */

.auth-body {
  min-height: 100vh;
}

.auth-aside-inner {
  width: 100%;
  max-width: 380px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  min-height: 100vh;
  width: 100%;
}

.auth-aside {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(165deg, rgba(56, 189, 248, 0.12) 0%, rgba(129, 140, 248, 0.06) 45%, rgba(10, 14, 23, 0) 100%);
  border-right: 1px solid var(--border);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 1.6rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  margin-bottom: 32px;
}

.auth-logo img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.auth-aside-title {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.auth-aside-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-aside-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 32px;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-point-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Right form column */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg-deep);
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-wrap h1 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-form-wrap .subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

/* Login method switcher */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 28px;
  padding: 5px;
  min-height: 48px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.auth-tab-slider {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.22), rgba(129, 140, 248, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow:
    0 2px 16px rgba(56, 189, 248, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}

.auth-tabs[data-active="code"] .auth-tab-slider {
  transform: translateX(calc(100% + 5px));
}

.auth-tabs .auth-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 11px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.22s ease;
  white-space: nowrap;
}

.auth-tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-tabs .auth-tab:hover {
  color: var(--text);
}

.auth-tabs .auth-tab.active {
  color: #e0f2fe;
  font-weight: 600;
}

.auth-tabs .auth-tab:hover .auth-tab-icon {
  opacity: 0.95;
}

.auth-tabs .auth-tab.active .auth-tab-icon {
  opacity: 1;
  color: var(--accent);
  transform: scale(1.05);
}

.auth-tabs .auth-tab:focus,
.auth-tabs .auth-tab:focus-visible {
  outline: none;
  box-shadow: none;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
  animation: authPanelIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
}

.auth-form-wrap .btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 13px 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
}

.auth-legal {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-legal a {
  color: var(--accent);
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}

.auth-error.show {
  display: block;
}

.auth-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}

.auth-success.show {
  display: block;
}

.code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.code-row input {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.code-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 108px;
  padding: 12px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.code-row .btn:hover:not(:disabled) {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}

.code-row .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--text-muted);
  border-color: var(--border);
  background: transparent;
}

/* Mobile: logo bar + form only */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  .auth-aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
  }

  .auth-aside-inner {
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .auth-aside-body {
    display: none;
  }

  .auth-logo {
    margin-bottom: 0;
    font-size: 1.35rem;
  }

  .auth-logo img {
    width: 42px;
    height: 42px;
  }

  .auth-main {
    padding: 28px 20px 40px;
    align-items: flex-start;
  }

  .auth-form-wrap h1 {
    font-size: 1.45rem;
  }

  .auth-form-wrap .subtitle {
    margin-bottom: 18px;
    font-size: 0.88rem;
  }

  .auth-tabs {
    margin-bottom: 22px;
    padding: 4px;
    border-radius: 12px;
  }

  .auth-tabs .auth-tab {
    padding: 10px 8px;
    font-size: 0.82rem;
    gap: 5px;
    min-height: 40px;
  }

  .auth-tab-icon {
    width: 15px;
    height: 15px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  @media (max-width: 400px) {
    .auth-tab span:not(.auth-tab-icon) {
      font-size: 0.8rem;
    }

    .code-row {
      flex-direction: column;
    }

    .code-row .btn {
      width: 100%;
      min-width: 0;
    }
  }
}
