/* Dedicated login/register stylesheet. Loaded after styles.css to avoid cached or older auth styles. */
html, body {
  margin: 0;
  min-height: 100%;
}

body:has(.auth-portal) {
  margin: 0;
  background: #eef3fb;
  overflow-x: hidden;
}

.auth-portal,
.auth-portal * {
  box-sizing: border-box;
}

.auth-portal {
  min-height: 100vh;
  background: #eef3fb;
  color: var(--text, #15213a);
}

.auth-sitebar {
  position: relative;
  z-index: 10;
  width: 100%;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid rgba(47, 91, 148, .10);
  box-shadow: 0 10px 24px rgba(18, 42, 82, .05);
}

.auth-sitebar-inner {
  width: min(1240px, calc(100% - 36px));
  min-height: 82px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.auth-sitebrand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.auth-sitebrand img {
  width: 72px !important;
  height: 48px !important;
  max-width: 72px !important;
  max-height: 48px !important;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 72px;
  display: block;
}

.auth-sitebrand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-sitebrand-text strong {
  color: var(--primary-deep, #153c7a);
  font-size: .98rem;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

.auth-sitebrand-text span {
  color: var(--text-soft, #60718f);
  font-size: .82rem;
  white-space: nowrap;
}

.auth-site-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  min-width: 0;
}

.auth-site-links a {
  color: var(--text, #15213a);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  padding: 9px 10px;
  border-radius: 12px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.auth-site-links a:hover {
  color: var(--primary-deep, #153c7a);
  background: rgba(47, 91, 148, .07);
  transform: translateY(-1px);
}

.auth-site-cta {
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--primary, #2f5b94);
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.auth-site-cta:hover {
  transform: translateY(-1px);
}

.auth-site-cta-solid {
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #2f5b94), var(--primary-deep, #163e7a));
  box-shadow: 0 14px 28px rgba(22, 62, 122, .18);
}

.auth-site-cta-outline {
  color: var(--primary-deep, #163e7a);
  background: #fff;
}

.auth-stage {
  position: relative;
  min-height: calc(100vh - 82px);
  padding: 18px 16px 56px;
  overflow: hidden;
  background: #f4f8fd;
}

.auth-stage-band {
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(270px, 42vh, 430px);
  background: linear-gradient(180deg, var(--primary-deep, #153c7a), var(--primary, #2f5b94));
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  margin: clamp(48px, 10vh, 88px) auto 0;
  padding: clamp(30px, 4vw, 46px);
  border-radius: 38px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(47, 91, 148, .08);
  box-shadow: 0 22px 54px rgba(12, 36, 76, .18), 0 4px 10px rgba(12, 36, 76, .06);
}

.auth-panel-login {
  width: min(710px, 100%);
}

.auth-panel-register {
  width: min(760px, 100%);
}

.auth-panel-header {
  margin-bottom: 26px;
  text-align: center;
}

.auth-panel-header h1 {
  margin: 0;
  color: var(--primary-deep, #153c7a);
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.02;
  letter-spacing: -.05em;
  font-weight: 900;
}

.auth-panel-header p {
  margin: 10px 0 0;
  color: var(--text-soft, #60718f);
  font-size: 1.02rem;
}

.auth-form-portal {
  display: grid;
  gap: 18px;
}

.auth-field-shell {
  display: grid;
  gap: 8px;
}

.auth-field-shell label {
  color: var(--text, #15213a);
  font-size: 1rem;
  font-weight: 800;
}

.auth-field-shell input,
.auth-field-shell select,
.auth-field-shell textarea {
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  border: 1px solid rgba(47, 91, 148, .20);
  border-radius: 14px;
  color: var(--text, #15213a);
  background: #fff;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-field-shell input:focus,
.auth-field-shell select:focus,
.auth-field-shell textarea:focus {
  outline: 0;
  border-color: rgba(47, 91, 148, .58);
  box-shadow: 0 0 0 4px rgba(47, 91, 148, .12);
}

.auth-field-shell input::placeholder {
  color: #8b9ab5;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: #7183a5;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle-icon--shown { display: none; }
.password-toggle.is-active .password-toggle-icon--hidden { display: none; }
.password-toggle.is-active .password-toggle-icon--shown { display: block; }

.auth-submit-btn {
  min-height: 56px;
  margin-top: 4px;
  border-radius: 14px;
  font-size: 1.04rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.auth-switch-plain,
.auth-panel .auth-switch {
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-soft, #60718f);
  text-align: center;
}

.auth-switch-plain a,
.auth-panel .auth-switch a {
  color: var(--primary-deep, #153c7a);
  font-weight: 900;
  text-decoration: none;
}

.auth-switch-plain a:hover,
.auth-panel .auth-switch a:hover {
  text-decoration: underline;
}

.register-role-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.register-role-pill:nth-child(n+3) {
  display: none;
}

.register-role-pill {
  position: relative;
  display: flex;
}

.register-role-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.register-role-pill span {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid rgba(47, 91, 148, .16);
  border-radius: 14px;
  color: var(--primary-deep, #153c7a);
  background: #f6f9ff;
  font-weight: 900;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.register-role-pill:hover span {
  transform: translateY(-1px);
}

.register-role-pill input:checked + span {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary, #2f5b94), var(--primary-deep, #153c7a));
  box-shadow: 0 14px 24px rgba(22, 62, 122, .18);
}

.register-section-clean,
.auth-form-portal .register-section-clean {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.register-section-clean[hidden],
.auth-form-portal .register-section[hidden] {
  display: none !important;
}

.register-grid {
  display: grid;
  gap: 14px;
}

.register-grid.two,
.register-grid-two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-note {
  color: var(--text-soft, #60718f);
  font-size: .8rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .auth-sitebar-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 14px 0;
    gap: 12px;
  }

  .auth-sitebrand {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .auth-stage {
    min-height: calc(100vh - 170px);
    padding: 12px 12px 28px;
  }

  .auth-stage-band {
    height: 220px;
  }

  .auth-panel {
    margin-top: 28px;
    padding: 24px 18px;
    border-radius: 28px;
  }

  .auth-panel-header h1 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
  }

  .register-role-pills,
  .register-grid.two,
  .register-grid.three,
  .register-grid-two-up {
    grid-template-columns: 1fr;
  }

  .auth-site-links {
    gap: 8px;
  }

  .auth-site-links a {
    font-size: .93rem;
  }
}


/* Compact modern login/register update */
body:has(.auth-portal){
  background:#f4f5fb;
}

.auth-portal{
  min-height:calc(100vh - 64px);
  background:#f4f5fb;
}

.auth-stage{
  min-height:calc(100vh - 64px);
  padding:28px 16px 44px;
  background:linear-gradient(180deg,#f4f5fb 0%,#eef3fb 100%);
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.auth-stage-band{display:none !important;}

.auth-panel{
  width:min(520px,100%);
  margin:0 auto;
  padding:28px 30px;
  border-radius:24px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(47,91,148,.12);
  box-shadow:0 18px 44px rgba(39,68,112,.12);
}

.auth-panel-login{width:min(460px,100%);}
.auth-panel-register{width:min(720px,100%);}

.auth-panel-header{margin-bottom:20px;}

.auth-panel-header h1{
  font-size:clamp(1.55rem,3vw,2.05rem);
  line-height:1.12;
  letter-spacing:-.035em;
}

.auth-panel-header p{
  margin-top:6px;
  font-size:.92rem;
}

.auth-form-portal{gap:14px;}
.auth-field-shell{gap:6px;}

.auth-field-shell label{
  font-size:.88rem;
  font-weight:750;
}

.auth-field-shell input,
.auth-field-shell select,
.auth-field-shell textarea{
  min-height:48px;
  padding:12px 14px;
  border-radius:12px;
  font-size:.92rem;
}

.password-field-wrap input{padding-right:46px;}
.password-toggle{right:12px;width:28px;height:28px;}

.auth-submit-btn{
  min-height:48px;
  margin-top:2px;
  border-radius:12px;
  font-size:.94rem;
  letter-spacing:.01em;
}

.auth-switch-plain,
.auth-panel .auth-switch{
  margin-top:12px;
  font-size:.88rem;
}

.register-role-pills{gap:8px;}
.register-role-pill span{
  min-height:44px;
  padding:10px 12px;
  border-radius:12px;
  font-size:.88rem;
}

.register-section-clean,
.auth-form-portal .register-section-clean,
.register-grid{
  gap:12px;
}

.field-note{font-size:.76rem;}

@media(max-width:768px){
  .auth-portal{min-height:calc(100vh - 122px);}
  .auth-stage{
    min-height:calc(100vh - 122px);
    padding:20px 12px 30px;
  }
  .auth-panel{
    padding:24px 18px;
    border-radius:22px;
  }
  .auth-panel-header{margin-bottom:18px;}
}

/* Match login and sign-up card widths */
.auth-panel-login,
.auth-panel-register {
  width: min(720px, 100%);
}

.auth-panel-login .auth-form-portal,
.auth-panel-login .auth-switch {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .auth-panel-login,
  .auth-panel-register {
    width: min(720px, 100%);
  }

  .auth-panel-login .auth-form-portal,
  .auth-panel-login .auth-switch {
    max-width: 100%;
  }
}

.login-role-pills{
  margin-bottom:18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.login-role-pills .register-role-pill:nth-child(n+3) {
  display: none;
}
@media (max-width: 640px){
  .login-role-pills,
  .register-role-pills{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
}
