:root {
  --primary-bg: #1455d9;
  --card-bg: rgba(7, 35, 122, .48);
  --accent: #2ceabc;
  --accent-strong: #00d09f;
  --text-light: #ffffff;
  --text-muted: rgba(255, 255, 255, .76);
}

body:has(.auth-page) {
  min-height: 100svh;
  background:
    linear-gradient(115deg, rgba(4, 19, 78, .72) 0 18%, transparent 18% 100%),
    linear-gradient(155deg, transparent 0 58%, rgba(44, 234, 188, .18) 58% 100%),
    linear-gradient(155deg, transparent 0 78%, rgba(54, 225, 219, .32) 78% 100%),
    linear-gradient(135deg, #0b2c9a 0%, #2169ea 45%, #18a9c3 100%);
}

main.container:has(.auth-page) {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  backdrop-filter: none;
}

.auth-page {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(300px, 450px) minmax(360px, 430px);
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 7vw, 7rem);
  min-height: 100svh;
  padding: clamp(1.5rem, 4vw, 4.5rem);
  overflow: hidden;
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(110deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .9), rgba(0, 0, 0, .2));
}

.auth-page::after {
  display: none;
}

.auth-container {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: .8rem;
  width: min(430px, 100%);
  margin: 0 auto;
  color: var(--text-light);
  text-align: center;
}

.auth-brand img {
  display: block;
  width: clamp(280px, 26vw, 420px);
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(1, 18, 73, .24));
}

.auth-brand span {
  display: block;
  width: 100%;
  color: var(--text-light);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 12px 28px rgba(1, 18, 73, .28);
}

.auth-card {
  position: relative;
  overflow: hidden;
  max-width: 430px;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .045)),
    var(--card-bg);
  border: 1px solid rgba(255, 255, 255, .24);
  color: var(--text-light);
  border-radius: 20px;
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow:
    0 24px 54px rgba(3, 18, 82, .28),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(22px) saturate(130%);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(44, 234, 188, .42), transparent 38%),
    linear-gradient(315deg, rgba(255, 255, 255, .14), transparent 40%);
  opacity: .55;
}

.auth-title {
  color: var(--accent);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 1.35rem;
  text-align: left;
}

.auth-card form,
.auth-title {
  position: relative;
  z-index: 1;
}

.auth-card label {
  color: var(--text-light);
  font-weight: 800;
}

.auth-card .form-control {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 13px;
  color: #0f2456;
  background: rgba(255, 255, 255, .92);
  font-size: 1.08rem;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

.form-control:focus {
  background: #ffffff;
  box-shadow:
    0 0 0 0.22rem rgba(44, 234, 188, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  border-color: var(--accent);
  outline: none;
}

.auth-card .input-group .form-control {
  border-right: 0;
  border-radius: 13px 0 0 13px;
}

.auth-card .input-group .btn.toggle-password {
  min-width: 54px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-left: 0;
  border-radius: 0 13px 13px 0;
  color: #0b5ebd;
  background: rgba(255, 255, 255, .92);
}

.auth-card .input-group .btn.toggle-password:hover,
.auth-card .input-group .btn.toggle-password:focus {
  color: #06327c;
  background: #ffffff;
}

.btn-accent {
  min-height: 52px;
  background: linear-gradient(135deg, #39efc8, var(--accent-strong));
  color: #06327c;
  font-weight: 900;
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  border: none;
  width: 100%;
  box-shadow: 0 12px 24px rgba(0, 208, 159, .2);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn-accent:hover,
.btn-accent:focus {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #4af3ca, #00c797);
  color: #05296b;
  box-shadow: 0 16px 30px rgba(0, 208, 159, .28);
  outline: none;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.auth-actions-single {
  grid-template-columns: 1fr;
}

.btn-auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem .85rem;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 13px;
  color: var(--text-light);
  background: rgba(255, 255, 255, .08);
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.btn-auth-secondary:hover,
.btn-auth-secondary:focus {
  transform: translateY(-1px);
  color: #07337e;
  background: var(--accent);
  outline: none;
}

@media (max-width: 820px) {
  .auth-page {
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.7rem;
    min-height: 100svh;
    padding: 1.35rem 14px 2rem;
  }

  .auth-brand {
    justify-items: center;
    text-align: center;
  }

  .auth-brand img {
    width: min(270px, 78vw);
  }

  .auth-brand span {
    min-height: 34px;
    font-size: 1rem;
  }

  .auth-card {
    padding: 1.35rem 1.45rem;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .auth-page {
    gap: 1.35rem;
    padding-top: 1rem;
  }

  .auth-brand img {
    width: min(245px, 76vw);
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }
}

.text-light-link {
  color: var(--text-light);
  text-decoration: none;
}

.text-light-link:hover,
.text-light-link:focus {
  color: #00c797;
  text-decoration: underline;
}
