/* Authentication: atmospheric scene, sculpted frame, and shared form controls. */
.auth-page {
  --auth-scene-image: url('../../../images/auth/connexion-atmosphere-v1-large.webp');
  --auth-paper: #15172e;
  --auth-ink: #f8f7ff;
  --auth-muted: #bac1dc;
  --auth-field: #0e1228;
  --auth-line: #616a89;
  --auth-edge: #a49be3;
  --auth-frame: linear-gradient(135deg, #d3d2ff 0%, #817cb5 18%, #353657 42%, #8185ba 68%, #c5bbf4 100%);
  --auth-purple: #bb9eff;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: #0e1030;
  color: var(--auth-ink);
  font: 16px/1.5 var(--font-ui);
}
:root[data-theme="light"] .auth-page {
  --auth-paper: #fefeff;
  --auth-ink: #10112b;
  --auth-muted: #5a5d77;
  --auth-field: #fafaff;
  --auth-line: #8e8eab;
  --auth-edge: #fff;
  --auth-frame: linear-gradient(135deg, #ffffff 0%, #d9d6ff 20%, #fefeff 39%, #c0dafa 61%, #f4f0ff 80%, #ffffff 100%);
  --auth-purple: #6d20e7;
  background: #f5f3ff;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-scenery {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(110deg, rgb(10 10 36 / .92), rgb(17 13 50 / .62) 52%, rgb(12 10 37 / .32)), var(--auth-scene-image) center / cover;
}
:root[data-theme="light"] .auth-scenery {
  background-image: linear-gradient(0deg, rgb(247 246 255 / .55), transparent 30%), var(--auth-scene-image);
}
.auth-scenery::after {
  content: '';
  position: absolute;
  inset: -10%;
  background: radial-gradient(ellipse at 57% 46%, rgb(138 89 255 / .17), transparent 42%), radial-gradient(ellipse at 65% 70%, rgb(98 235 255 / .13), transparent 30%);
  animation: auth-light-breathe 14s ease-in-out infinite alternate;
}
@keyframes auth-light-breathe {
  from { opacity: .4; transform: translate3d(-1%, 1%, 0); }
  to { opacity: 1; transform: translate3d(1%, -1%, 0); }
}
.auth-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 24px 48px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 14px; color: var(--auth-ink); font-size: 28px; font-weight: 800; letter-spacing: -1px; text-decoration: none; }
.auth-brand img { width: 52px; height: 52px; object-fit: contain; }
.auth-brand strong { color: var(--auth-purple); }
.auth-topbar .theme-toggle--public { min-height: 46px; padding: 0 20px; color: var(--auth-ink); background: var(--auth-paper); border: 1px solid var(--auth-edge); box-shadow: inset 0 1px 0 rgb(255 255 255 / .32); }
.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  width: 100%;
  max-width: 1540px;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
  align-items: center;
  gap: clamp(36px, 4.5vw, 76px);
  margin: 0 auto;
  padding: 12px 48px 24px;
}
.auth-aside { position: relative; min-width: 0; align-self: stretch; min-height: 500px; }
.auth-aside__copy { position: relative; z-index: 1; padding-top: 20px; }
.auth-aside h2 { margin: 0; color: var(--auth-ink); font-size: clamp(36px, 3.6vw, 61px); line-height: 1.08; letter-spacing: -2px; font-weight: 800; text-wrap: balance; }
.auth-aside h2 span { color: var(--auth-purple); }
.auth-portrait { position: absolute; bottom: -24px; left: 8%; display: block; width: min(100%, 570px); height: auto; max-height: calc(100% - 160px); object-fit: contain; object-position: center bottom; mask-image: linear-gradient(#000 85%, transparent 100%); }
.auth-aside__symbol { position: absolute; inset: 35% 0 0; text-align: center; font: italic 150px/1.8 Georgia, serif; color: #8ce9f6; opacity: .75; }
.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 32px;
  border: 10px solid transparent;
  border-radius: 44px;
  background: linear-gradient(var(--auth-paper), var(--auth-paper)) padding-box, var(--auth-frame) border-box;
  box-shadow: 0 0 0 1px rgb(234 226 255 / .65), inset 0 0 0 1px rgb(216 207 255 / .55), 0 0 28px rgb(170 143 255 / .3);
  color: var(--auth-ink);
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 95px;
  height: 95px;
  border-radius: 50% 30px 50% 50%;
  background: radial-gradient(circle at 78% 12%, rgb(164 116 255 / .22), transparent 68%), linear-gradient(140deg, transparent 42%, rgb(88 221 248 / .13));
  pointer-events: none;
}
.auth-card > * { position: relative; grid-column: 1 / -1; min-width: 0; }
.auth-heading { grid-column: 1 / -1; grid-row: 1; margin: 0 0 28px; align-self: center; }
.auth-heading h1 { margin: 0; color: var(--auth-ink); font-size: 40px; line-height: 1.15; font-weight: 800; letter-spacing: -1.6px; }
.auth-heading p { margin: 8px 0 0; color: var(--auth-muted); font-size: 14px; }
.auth-page :is(.login-form, .register-form) { display: grid; gap: 22px; }
.auth-page .form-group { display: grid; gap: 8px; }
.auth-page label { color: var(--auth-ink); font-size: 14px; font-weight: 700; }
.auth-page :is(input:not([type='checkbox']):not([type='hidden']), select) { width: 100%; min-width: 0; min-height: 52px; padding: 12px 14px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-field); color: var(--auth-ink); font: inherit; box-shadow: inset 0 2px 4px rgb(44 32 98 / .06), 0 1px 0 rgb(255 255 255 / .1); transition: border-color .16s, box-shadow .16s; }
.auth-page input:is(:autofill, :-webkit-autofill) { -webkit-text-fill-color: var(--auth-ink); box-shadow: 0 0 0 1000px var(--auth-field) inset; }
.auth-page :is(input, select)[aria-invalid='true'] { border-color: var(--app-danger); }
.auth-page :is(a, button, input, select):focus-visible { outline: 3px solid var(--auth-purple); outline-offset: 3px; }
.auth-page .auth-inline-status .auth-declared-class { margin-top: 12px; }
.auth-class-choice { position: relative; min-width: 0; }
.auth-page .auth-class-choice select { appearance: none; padding-right: 48px; border-color: var(--auth-edge); font-weight: 600; background: linear-gradient(115deg, rgb(135 113 202 / .12), transparent), var(--auth-field); }
.auth-class-choice__icon { position: absolute; right: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--auth-purple); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.auth-page .auth-class-choice__help { margin: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.4; }
@media (forced-colors: active) { .auth-page .auth-class-choice select { appearance: auto; } .auth-class-choice__icon { display: none; } }
.auth-page .password-wrapper { position: relative; }
.auth-page .password-wrapper input { padding-right: 52px; }
.auth-page .toggle-pw-visibility { position: absolute; right: 5px; top: 5px; width: 42px; height: 42px; padding: 11px; border: 0; border-radius: 8px; background: transparent; color: var(--auth-muted); cursor: pointer; box-shadow: none; }
.auth-page .toggle-pw-visibility svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.auth-page .toggle-pw-visibility:hover { color: var(--auth-ink); background: rgb(135 113 202 / .12); }
.auth-forgot { justify-self: end; margin: 0; color: var(--auth-muted); font-size: 13px; text-underline-offset: 3px; }
.auth-page :is(.btn-login, .btn-register) { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; padding: 13px 18px; border: 1px solid #ab8aff; border-bottom-color: #5e23d0; border-radius: 13px; background: linear-gradient(115deg, #963df4, #6120ed 70%, #6639ef); color: #fff; font: 700 16px/1.3 var(--font-ui); text-decoration: none; cursor: pointer; box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 -2px 0 rgb(42 15 105 / .17); transition: filter .15s, transform .15s; }
.auth-page :is(.btn-login, .btn-register):hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.auth-page :is(.btn-login, .btn-register):active:not(:disabled) { transform: translateY(1px); }
.auth-page :is(.btn-login, .btn-register):disabled { opacity: .6; cursor: wait; }
.auth-switch { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--auth-line); text-align: center; color: var(--auth-muted); font-size: 13px; }
.auth-switch a { display: inline-flex; align-items: center; min-height: 32px; margin-left: 4px; color: var(--auth-purple); font-weight: 700; text-underline-offset: 3px; }
.auth-page .btn-login--inline { min-height: 40px; width: auto; font-size: 13px; box-shadow: none; padding: 10px 12px; }
.auth-page .auth-inline-status__button--secondary { background: var(--auth-paper); border-color: var(--auth-line); color: var(--auth-ink); box-shadow: none; }
.auth-page :is(.error-alert, .auth-inline-status) { margin: 0 0 22px; padding: 14px; border: 1px solid var(--auth-line); border-left: 3px solid var(--app-danger); border-radius: 10px; background: var(--auth-field); color: var(--auth-ink); font-size: 14px; }
.auth-page :is(.error-alert, .auth-inline-status)[hidden] { display: none; }
.auth-page .auth-inline-status--opportunity { border-left-color: var(--app-accent-cyan); }
.auth-page .auth-inline-status--success { border-left-color: var(--app-success); }
.auth-page :is(.error-alert, .auth-inline-status) p { margin: 0; }
.auth-page .error-title { font-weight: 700; margin-bottom: 6px; }
.auth-page .auth-inline-status__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.auth-page .error-alert__form { display: grid; gap: 10px; margin-top: 14px; }
.auth-page .auth-consent { margin-top: 14px; }
.auth-page .auth-consent__label { display: flex; gap: 10px; align-items: start; }
.auth-page .auth-consent__checkbox { appearance: none; display: grid; place-content: center; margin: 3px 0 0; width: 19px; height: 19px; flex: 0 0 auto; border: 1.5px solid var(--auth-muted); border-radius: 3px; background: var(--auth-field); cursor: pointer; }
.auth-page .auth-consent__checkbox:checked { background: #7028e7; border-color: #7028e7; }
.auth-page .auth-consent__checkbox:checked::after { content: ''; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (forced-colors: active) { .auth-page .auth-consent__checkbox { appearance: auto; } .auth-page .auth-consent__checkbox::after { display: none; } }
.auth-page .auth-consent__copy { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.auth-page .auth-consent__help { color: var(--auth-muted); font-size: 12px; }
.auth-footer { position: relative; z-index: 1; padding: 12px 24px; text-align: center; color: var(--auth-muted); background: linear-gradient(transparent, rgb(10 12 32 / .85) 35%); }
:root[data-theme="light"] .auth-footer { background: linear-gradient(transparent, rgb(248 247 255 / .94) 35%); }
.auth-signature { margin: 0 auto 6px; font-size: 12px; line-height: 1.5; }
.auth-page .footer { margin: 0; padding: 0; border: 0; color: var(--auth-muted); font-size: 11px; line-height: 1.5; }
.auth-page .footer div { display: inline; margin: 0; }
.auth-page .footer div + div::before { content: ' · '; }
.auth-page .footer a { display: inline-block; padding: 3px 2px; color: var(--auth-muted); }
.auth-page .footer a:hover { color: var(--auth-purple); text-decoration: underline; }
@media (max-width: 1100px) {
  .auth-topbar { padding: 20px 32px; }
  .auth-layout { gap: 30px; padding-inline: 32px; grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
  .auth-aside h2 { font-size: 37px; letter-spacing: -1.4px; }
  .auth-portrait { left: 0; width: 100%; max-height: calc(100% - 180px); }
  .auth-card { padding: 26px; border-width: 8px; border-radius: 36px; }
  .auth-heading h1 { font-size: 34px; }
}
@media (max-width: 960px) {
  .auth-topbar { padding: 14px 24px; }
  .auth-brand { gap: 9px; font-size: 22px; letter-spacing: -.7px; }
  .auth-brand img { width: 38px; height: 38px; }
  .auth-topbar .theme-toggle--public { min-width: 44px; min-height: 44px; padding: 0; grid-template-columns: 20px; }
  .auth-topbar .theme-toggle__label { display: none; }
  .auth-layout { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 20px; max-width: 510px; padding: 6px 24px 18px; }
  .auth-aside { width: 100%; min-height: 0; align-self: auto; }
  .auth-aside__copy { padding: 0; }
  .auth-aside h2 { max-width: 22ch; margin: auto; font-size: clamp(25px, 4.5vw, 33px); text-align: center; line-height: 1.1; letter-spacing: -.9px; }
  .auth-aside h2 br { display: none; }
  .auth-portrait, .auth-aside__symbol { display: none; }
  .auth-card { width: 100%; padding: 24px; border-width: 6px; border-radius: 32px; }
  .auth-card::before { width: 60px; height: 60px; }
  .auth-heading { margin-bottom: 20px; }
  .auth-heading h1 { font-size: 32px; letter-spacing: -1px; }
  .auth-page :is(.login-form, .register-form) { gap: 16px; }
  .auth-page .form-group { gap: 6px; }
  .auth-page :is(input:not([type='checkbox']):not([type='hidden']), select) { min-height: 48px; padding-block: 10px; }
  .auth-page .toggle-pw-visibility { top: 3px; }
  .auth-page :is(.btn-login, .btn-register) { min-height: 48px; }
  .auth-switch { margin-top: 20px; padding-top: 14px; }
  .auth-footer { padding: 8px 18px 12px; }
  .auth-signature { max-width: 52ch; font-size: 11px; }
  .auth-page .footer { font-size: 10px; }
  .auth-scenery { --auth-scene-image: url('../../../images/auth/connexion-atmosphere-v1-small.webp'); background-position: 40% center; }
  :root[data-theme="light"] .auth-scenery { background-image: linear-gradient(120deg, rgb(248 246 255 / .68), rgb(244 241 255 / .3)), var(--auth-scene-image); }
}
@media (max-height: 850px) and (min-width: 961px) {
  .auth-topbar { padding-block: 16px; }
  .auth-brand img { width: 46px; height: 46px; }
  .auth-layout { padding-block: 4px 16px; }
  .auth-aside { min-height: 440px; }
  .auth-aside__copy { padding-top: 8px; }
  .auth-aside h2 { font-size: clamp(34px, 3.25vw, 52px); }
  .auth-portrait { max-height: calc(100% - 125px); bottom: -16px; }
  .auth-card { padding: 26px; border-width: 8px; }
  .auth-heading { margin-bottom: 22px; }
  .auth-heading h1 { font-size: 36px; }
  .auth-page :is(.login-form, .register-form) { gap: 18px; }
  .auth-page :is(input:not([type='checkbox']):not([type='hidden']), select) { min-height: 48px; padding-block: 10px; }
  .auth-page .toggle-pw-visibility { top: 3px; }
  .auth-switch { margin-top: 20px; padding-top: 16px; }
  .auth-footer { padding-block: 8px; }
}
@media (max-height: 740px) and (max-width: 960px) {
  .auth-topbar { padding-block: 8px; }
  .auth-layout { gap: 12px; padding: 2px 18px 10px; }
  .auth-aside h2 { font-size: 24px; max-width: 24ch; }
  .auth-card { padding: 16px 18px; border-width: 5px; border-radius: 28px; }
  .auth-heading { margin-bottom: 12px; }
  .auth-heading h1 { font-size: 29px; }
  .auth-page :is(.login-form, .register-form) { gap: 12px; }
  .auth-page .form-group { gap: 4px; }
  .auth-page :is(input:not([type='checkbox']):not([type='hidden']), select) { min-height: 44px; padding-block: 8px; }
  .auth-page .toggle-pw-visibility { top: 1px; }
  .auth-page :is(.btn-login, .btn-register) { min-height: 46px; padding-block: 11px; }
  .auth-switch { margin-top: 14px; padding-top: 10px; font-size: 12px; }
  .auth-switch a { min-height: 26px; }
  .auth-footer { padding-top: 4px; padding-bottom: 8px; }
}
@media (max-height: 600px) and (max-width: 960px) {
  .auth-topbar { padding: 4px 18px; }
  .auth-brand { font-size: 20px; }
  .auth-brand img { width: 34px; height: 34px; }
  .auth-layout { gap: 8px; padding-block: 0 6px; }
  .auth-aside h2 { font-size: 21px; }
  .auth-card { padding: 12px 16px; }
  .auth-heading { margin-bottom: 8px; }
  .auth-heading h1 { font-size: 27px; }
  .auth-page :is(.login-form, .register-form) { gap: 10px; }
  .auth-switch { margin-top: 10px; padding-top: 8px; }
  .auth-signature { font-size: 10px; margin-bottom: 3px; }
}
@media (max-height: 540px) and (min-width: 600px) {
  .auth-topbar { padding: 4px 24px; }
  .auth-brand { font-size: 21px; }
  .auth-brand img { width: 36px; height: 36px; }
  .auth-topbar .theme-toggle--public { min-height: 42px; }
  .auth-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(350px, 1.2fr); gap: 22px; max-width: 1100px; padding: 2px 24px 8px; }
  .auth-aside { min-height: 0; align-self: center; }
  .auth-aside__copy { padding: 0; }
  .auth-aside h2 { font-size: 28px; text-align: left; letter-spacing: -1px; }
  .auth-portrait, .auth-aside__symbol { display: none; }
  .auth-card { padding: 12px; border-width: 4px; border-radius: 26px; }
  .auth-heading { margin-bottom: 6px; }
  .auth-heading h1 { font-size: 28px; }
  .auth-page :is(.login-form, .register-form) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .auth-page .form-group { gap: 4px; align-content: start; }
  .auth-page :is(input:not([type='checkbox']):not([type='hidden']), select) { min-height: 44px; padding: 8px 10px; }
  .auth-page .password-wrapper input { padding-right: 44px; }
  .auth-page .toggle-pw-visibility { top: 1px; right: 1px; }
  .auth-forgot { font-size: 11px; }
  .auth-page :is(.btn-login, .btn-register) { grid-column: 1 / -1; min-height: 44px; padding-block: 10px; }
  .auth-switch { margin-top: 8px; padding-top: 6px; font-size: 11px; }
  .auth-switch a { min-height: 26px; }
  .auth-footer { padding: 4px 20px 6px; }
  .auth-signature { font-size: 11px; margin-bottom: 3px; }
  .auth-page .footer { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-scenery::after { animation: none; }
  .auth-page *, .auth-page *::before, .auth-page *::after { transition: none; }
}


/* Equal-width, clearly outlined navigation tabs. */
.auth-mode-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.auth-mode-nav__link { display: flex; justify-content: center; align-items: center; min-height: 56px; padding: 10px 12px; border: 1px solid var(--auth-purple); border-radius: 14px; color: var(--auth-purple); background: var(--auth-field); font-size: clamp(18px, 1.65vw, 23px); font-weight: 750; line-height: 1.2; letter-spacing: -.35px; text-decoration: none; transition: background .18s, transform .18s; }
.auth-mode-nav__link[aria-current='page'] { border-color: #a878ff #6e29e1 #6422cb #a878ff; background: linear-gradient(115deg, #913af0, #6523e5); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 -1px 0 rgb(30 9 93 / .18); }
.auth-mode-nav__link:not([aria-current]):hover { background: color-mix(in srgb, var(--auth-purple) 12%, var(--auth-paper)); transform: translateY(-1px); }
@media (max-width: 960px) { .auth-mode-nav__link { min-height: 52px; font-size: 21px; } }
@media (max-width: 380px) { .auth-mode-nav { gap: 10px; } .auth-mode-nav__link { min-height: 46px; padding-inline: 6px; font-size: 18px; border-radius: 11px; } }
@media (max-height: 540px) and (min-width: 600px) { .auth-mode-nav__link { min-height: 42px; font-size: 19px; padding-block: 7px; border-radius: 10px; } }
@media (prefers-reduced-motion: reduce) { .auth-mode-nav__link { transition: none; } }

/* Registration adds one field: keep a regular rhythm without an extra consent gap. */
.auth-register-page .auth-consent { margin-top: 0; }
.auth-page .btn-register { font-size: 18px; }
