* {
  box-sizing: border-box;
}

:root {
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #18212f;
  background: #f4f7fb;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 20%, #dbeafe 0, transparent 30%),
    radial-gradient(circle at 85% 80%, #ede9fe 0, transparent 30%),
    #f4f7fb;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.user-card {
  width: 100%;
  max-width: 440px;
  padding: 36px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(35, 48, 74, 0.14);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.brand h1 {
  margin: 0 0 5px;
  font-size: 24px;
}

.brand p {
  margin: 0;
  color: #768196;
  font-size: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 26px;
  padding: 5px;
  background: #eef2f7;
  border-radius: 12px;
}

.tab {
  padding: 11px;
  color: #697386;
  background: transparent;
  border: 0;
  border-radius: 9px;
  transition: 0.2s ease;
}

.tab.active {
  color: #2563eb;
  font-weight: 600;
  background: #fff;
  box-shadow: 0 3px 12px rgba(34, 49, 76, 0.08);
}

.form {
  display: grid;
  gap: 18px;
}

.form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.form input {
  width: 100%;
  padding: 13px 14px;
  color: #18212f;
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  outline: none;
  transition: 0.2s ease;
}

.form input::placeholder {
  color: #a4adbb;
}

.form input:focus {
  border-color: #4f7df3;
  box-shadow: 0 0 0 4px rgba(79, 125, 243, 0.12);
}

.primary-button,
.logout-button {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 11px;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.primary-button {
  margin-top: 4px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #6d5ce7);
  box-shadow: 0 10px 24px rgba(54, 88, 220, 0.22);
}

.primary-button:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.logout-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 10px;
}

.message.success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.message.error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fee4e2;
}

.user-card {
  text-align: center;
}

.avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  border-radius: 24px;
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.25);
}

.welcome {
  margin: 0 0 8px;
  color: #768196;
  font-size: 14px;
}

.user-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-state {
  margin: 10px 0 28px;
  color: #768196;
}

.logout-button {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #fecaca;
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .page {
    padding: 16px;
  }

  .auth-card,
  .user-card {
    padding: 26px 22px;
    border-radius: 20px;
  }
}