/* Institutional OUT4 palette for the unified login and registration forms. */
:root:has(.auth-page),
body:has(.auth-page),
#root:has(.auth-page) {
  background:#fff;
  color-scheme:light;
}

.auth-page:has(form) {
  --login-ink:#171d19;
  --login-muted:#4f5b52;
  --login-green:#8cf48f;
  --login-deep:#246537;
  --login-line:#d9e1da;
  min-height:100vh;
  min-height:100dvh;
  padding:96px 24px 64px;
  align-items:center;
  background:#fff;
  color:var(--login-ink);
  font-family:"Plus Jakarta Sans",Arial,sans-serif;
}

.auth-page:has(form) .auth-card {
  max-width:500px;
  padding:38px;
  background:#fff;
  border:1px solid var(--login-line);
  border-radius:28px;
  box-shadow:0 14px 45px #182e160d;
}

.auth-page:has(form) .auth-card::before {
  content:"";
  display:block;
  width:110px;
  height:52px;
  margin-bottom:26px;
  background:url("./out4-logo.png") left center / contain no-repeat;
}

.auth-page:has(form) .auth-header {
  margin-bottom:30px;
}

.auth-page:has(form) .auth-header h1 {
  margin:0 0 12px;
  color:var(--login-ink);
  font-size:30px!important;
  font-weight:700!important;
  line-height:1.15;
  letter-spacing:-.03em;
}

.auth-page:has(form) .auth-header p {
  color:var(--login-muted);
  font-size:17px;
  line-height:1.6;
}

.auth-page:has(form) :is(.auth-form,.register-form) {
  gap:22px;
}

.auth-page:has(form) :is(.auth-form,.register-form) label {
  gap:9px;
  color:var(--login-ink);
  font-size:14px;
  font-weight:700!important;
}

.auth-page:has(form) :is(.auth-form,.register-form) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  min-height:52px;
  padding:13px 15px;
  background:#fff;
  border:1px solid #b7c1b8;
  border-radius:12px;
  color:var(--login-ink);
  font-size:16px;
  font-weight:400;
  box-shadow:none;
}

.auth-page:has(form) :is(.auth-form,.register-form) :is(input,textarea)::placeholder {
  color:#68756b;
  opacity:1;
}

.auth-page:has(form) :is(.auth-form,.register-form) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus {
  background:#fff;
  border-color:var(--login-deep);
  box-shadow:0 0 0 3px #8cf48f55;
}

.auth-page:has(form) .primary-button {
  min-height:52px;
  margin-top:4px;
  padding:14px 24px;
  border:1px solid var(--login-green);
  border-radius:99px;
  background:var(--login-green);
  color:var(--login-ink);
  font-size:18px;
  font-weight:400!important;
  line-height:1.3;
}

.auth-page:has(form) .primary-button:hover:not(:disabled) {
  background:var(--login-ink);
  border-color:var(--login-ink);
  color:var(--login-green);
  transform:none;
}

.auth-page:has(form) :is(a,button):focus-visible {
  outline:2px solid var(--login-deep);
  outline-offset:4px;
}

.auth-page:has(form) .auth-footer {
  flex-wrap:wrap;
  margin-top:26px;
  gap:6px;
  color:var(--login-muted);
  font-size:14px;
  line-height:1.6;
}

.auth-page:has(form) .auth-footer a {
  color:var(--login-deep);
  font-weight:700;
}

.auth-page:has(form) .alert-error {
  background:#fff3f2;
  border-color:#efc4c0;
  color:#912f29;
}

@media (max-width:600px) {
  .auth-page:has(form) {
    align-items:flex-start;
    padding:88px 16px 28px;
  }
  .auth-page:has(form) .auth-card {
    padding:28px 24px;
    border-radius:24px;
    box-shadow:0 8px 28px #182e160a;
  }
  .auth-page:has(form) .auth-header h1 {
    font-size:27px!important;
  }
  .auth-page:has(form) .auth-header p {
    font-size:16px;
  }
}
.auth-page:has(form) .register-card {
  max-width:980px;
}

.auth-page:has(form) .account-type-card {
  border-color:var(--login-line);
  background:#fff;
  color:var(--login-ink);
}

.auth-page:has(form) .account-type-card svg {
  color:var(--login-deep);
}

.auth-page:has(form) .account-type-card strong {
  color:var(--login-ink);
  font-size:18px;
  font-weight:700!important;
}

.auth-page:has(form) .account-type-card span {
  color:var(--login-muted);
  line-height:1.5;
}

.auth-page:has(form) .account-type-card:hover {
  border-color:var(--login-deep);
  background:#f7faf7;
  transform:none;
}

.auth-page:has(form) .account-type-card.active {
  border-color:var(--login-deep);
  background:#e9fbea;
  box-shadow:0 0 0 2px #8cf48f55;
}

.auth-page:has(form) .register-section-title h2 {
  margin:0 0 8px;
  color:var(--login-ink);
  font-size:21px!important;
  font-weight:700!important;
}

.auth-page:has(form) .register-section-title p {
  color:var(--login-muted);
  font-size:15px;
  line-height:1.6;
}

.auth-page:has(form) .register-extra-box {
  padding:24px;
  border-color:var(--login-line);
  background:#f7faf7;
}

.auth-page:has(form) .register-form textarea {
  min-height:112px;
}

.auth-page:has(form) .sports-check-list > span {
  color:var(--login-ink);
  font-size:14px;
  font-weight:700;
}

.auth-page:has(form) .sports-check-list label {
  border:1px solid var(--login-line);
  background:#fff;
  color:var(--login-ink);
}

.auth-page:has(form) .sports-check-list label:has(input:checked) {
  border-color:var(--login-deep);
  background:#e9fbea;
}

.auth-page:has(form) .register-form input[type="checkbox"] {
  width:18px;
  height:18px;
  min-height:18px;
  padding:0;
  accent-color:var(--login-deep);
}

.auth-page:has(form) .secondary-button {
  min-height:52px;
  padding:14px 24px;
  border:1px solid #b7c1b8;
  border-radius:99px;
  background:#fff;
  color:var(--login-ink);
  font-size:16px;
  font-weight:400!important;
}

.auth-page:has(form) .secondary-button:hover:not(:disabled) {
  border-color:var(--login-deep);
  background:#f1f9f2;
}

.auth-page:has(form) .dialog-actions {
  align-items:center;
  gap:14px;
  margin-top:12px;
}

.auth-page:has(form) .dialog-actions .primary-button {
  margin-top:0;
}

@media (max-width:600px) {
  .auth-page:has(form) .register-extra-box { padding:18px; }
  .auth-page:has(form) .dialog-actions { align-items:stretch; }
}


/* Shared navigation remains outside the React root and is visible on auth pages only. */
.auth-home-nav { display:none; }
body:has(.auth-page) > .auth-home-nav {
  position:absolute;
  top:20px;
  left:24px;
  z-index:5;
  display:flex;
  font-family:"Plus Jakarta Sans",Arial,sans-serif;
}
.auth-home-nav .auth-home-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:44px;
  padding:10px 18px;
  border:1px solid #d9e1da;
  border-radius:99px;
  background:#fff;
  color:#246537;
  font-size:14px;
  font-weight:600;
  line-height:1.5;
  text-decoration:none;
}
.auth-home-nav .auth-home-link:hover {
  border-color:#246537;
  background:#e9fbea;
}
.auth-home-nav .auth-home-link:focus-visible {
  outline:2px solid #246537;
  outline-offset:4px;
}
@media (max-width:600px) {
  body:has(.auth-page) > .auth-home-nav { top:16px; left:16px; }
}

.auth-page:has(form) .profile-choice {
  display:flex; flex-direction:column; align-items:flex-start; gap:8px;
  width:100%; min-height:84px; padding:18px 20px; text-align:left;
  border:1px solid var(--login-line); border-radius:16px;
  background:#fff; color:var(--login-ink); font-family:inherit;
}
.auth-page:has(form) .profile-choice strong { color:var(--login-ink); font-size:18px; }
.auth-page:has(form) .profile-choice span { color:var(--login-muted); font-size:14px; line-height:1.5; }
.auth-page:has(form) .profile-choice:hover:not(:disabled) { border-color:var(--login-deep); background:#e9fbea; }
.auth-page:has(form) .profile-choice:disabled { opacity:.65; cursor:wait; }

/* A quiet branded backdrop belongs to the login and its profile chooser only. */
.auth-page:has(> .auth-card:not(.register-card)) {
  position:relative;
  isolation:isolate;
  background:
    radial-gradient(ellipse at 8% 12%, #8cf48f1a, transparent 48%),
    radial-gradient(ellipse at 95% 88%, #8cf48f20, transparent 50%),
    #f7faf7;
}
.auth-page:has(> .auth-card:not(.register-card))::before,
.auth-page:has(> .auth-card:not(.register-card))::after {
  content:"";
  position:absolute;
  z-index:-1;
  pointer-events:none;
  background:#246537;
  -webkit-mask:url("./out4-logo.png") center / contain no-repeat;
  mask:url("./out4-logo.png") center / contain no-repeat;
}
.auth-page:has(> .auth-card:not(.register-card))::before {
  width:clamp(220px,27vw,430px);
  height:clamp(120px,14vw,225px);
  left:3vw;
  bottom:9%;
  opacity:.055;
  transform:rotate(-8deg);
}
.auth-page:has(> .auth-card:not(.register-card))::after {
  width:clamp(200px,22vw,340px);
  height:clamp(105px,11.5vw,180px);
  right:2vw;
  top:14%;
  opacity:.03;
  transform:rotate(10deg);
}
.auth-page:has(> .auth-card:not(.register-card)) > .auth-card {
  position:relative;
  z-index:1;
  background:#fff;
}
@media (max-width:600px) {
  .auth-page:has(> .auth-card:not(.register-card))::before {
    top:8px;
    right:18px;
    bottom:auto;
    left:auto;
    width:150px;
    height:78px;
    opacity:.05;
    transform:none;
  }
  .auth-page:has(> .auth-card:not(.register-card))::after { content:none; }
}
