:root {
  --text: #122038;
  --text-soft: #5b677d;
  --line: rgba(18, 32, 56, 0.1);
  --brand: #0d7a63;
  --brand-dark: #0a5c4b;
  --surface: rgba(255, 255, 255, 0.9);
  --success-bg: #e7f7f0;
  --success-text: #0b6c54;
  --error-bg: #fff1f1;
  --error-text: #8e2d2d;
  --info-bg: #eef4ff;
  --info-text: #1f57a5;
  --shadow: 0 28px 70px rgba(19, 32, 52, 0.14);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 122, 99, 0.18), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(245, 166, 35, 0.16), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8fb 54%, #edf3f7 100%);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.auth-shell {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #0d7a63 0%, #18a77f 100%);
  box-shadow: 0 16px 35px rgba(13, 122, 99, 0.26);
}

.logo span:last-child {
  color: var(--brand-dark);
}

.top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.15rem;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(18, 32, 56, 0.08);
  box-shadow: 0 14px 30px rgba(19, 32, 52, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.top-link:hover,
.top-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(19, 32, 52, 0.12);
}

.auth-stage {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 540px);
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(18, 32, 56, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mode-switch a {
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(18, 32, 56, 0.08);
  color: var(--text-soft);
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.mode-switch a:hover,
.mode-switch a:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(19, 32, 52, 0.08);
}

.mode-switch a.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0d7a63 0%, #169772 100%);
  box-shadow: 0 18px 35px rgba(13, 122, 99, 0.22);
}

.bear-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.3rem;
  background:
    radial-gradient(circle at top left, rgba(13, 122, 99, 0.14), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(245, 166, 35, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
  border: 1px solid rgba(18, 32, 56, 0.06);
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bear-stage::after {
  content: "";
  position: absolute;
  inset: auto 18% 18px;
  height: 14px;
  border-radius: 999px;
  background: rgba(18, 32, 56, 0.08);
  filter: blur(12px);
}

.bear-frame {
  position: relative;
  z-index: 1;
  width: min(80%, 520px);
  border-radius: 28px;
  overflow: hidden;
  background: #2790b5;
  box-shadow: 0 20px 42px rgba(19, 32, 52, 0.12);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.bear-image {
  display: block;
  width: 100%;
  height: auto;
}

.bear-stage.is-password-active .bear-frame {
  transform: translateY(4px) scale(1.02);
  filter: saturate(0.94);
}

.auth-copy {
  margin-bottom: 1.05rem;
}

.auth-copy h1 {
  font-family: "Poppins", sans-serif;
  font-size: clamp(2rem, 4vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
  margin-bottom: 0.35rem;
}

.auth-copy p {
  color: var(--text-soft);
}

.message {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
}

.message.success {
  background: var(--success-bg);
  border-color: rgba(11, 108, 84, 0.12);
  color: var(--success-text);
}

.message.error {
  background: var(--error-bg);
  border-color: rgba(196, 61, 61, 0.12);
  color: var(--error-text);
}

.message.info {
  background: var(--info-bg);
  border-color: rgba(31, 87, 165, 0.12);
  color: var(--info-text);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-size: 0.96rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid rgba(18, 32, 56, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 1rem 1rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.field input:focus {
  border-color: rgba(13, 122, 99, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 122, 99, 0.1);
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #0d7a63 0%, #169772 100%);
  box-shadow: 0 18px 35px rgba(13, 122, 99, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(13, 122, 99, 0.28);
}

.auth-footer {
  margin-top: 1.05rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.auth-footer a {
  color: var(--brand-dark);
  font-weight: 700;
}

@media (max-width: 640px) {
  .auth-shell {
    padding-top: 1rem;
  }

  .auth-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1rem;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .bear-stage {
    min-height: 220px;
  }

  .bear-frame {
    width: 88%;
    border-radius: 22px;
  }
}
