.auth-main { container-type: inline-size; }
.mobile-view .auth-main { width: min(100%,450px); margin-inline: auto; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr);
  width: min(1072px,calc(100% - 64px));
  margin: clamp(28px,5vw,65px) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 56px #1e1e1e10;
}
.auth-layout-login { max-width: 960px; }
.auth-landscape {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 360px;
  padding: clamp(28px,5.7vw,58px) clamp(24px,3.2vw,45px);
  color: #fff5e4;
  background: linear-gradient(160deg,#191919e8 0%,#2b2b2b47 44%,#1e1e1e12 59%,#1c1c1cfb 100%), url('/assets/arbellia.webp') 51% center / cover;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: .98rem; font-weight: 850; letter-spacing: .11em; }
.auth-brand img { border-radius: 13px; }
.auth-landscape-copy span { display: block; width: 39px; height: 2px; margin-bottom: 17px; background: #ebcd943d; box-shadow: 12px 0 0 #f3dba4; }
.auth-landscape-copy h2 { margin: 0 0 4px; font-size: clamp(2.4rem,4.4vw,3.45rem); letter-spacing: -.065em; }
.auth-landscape-copy p { margin: 0; color: #e5e5e5; font-size: .94rem; }
.auth-content { min-width: 0; padding: clamp(25px,4.6vw,54px); }
.auth-back { display: inline-block; margin-bottom: 21px; color: var(--accent); font-size: .84rem; font-weight: 750; }
.auth-content h1 { margin: 0; font-size: clamp(1.75rem,3.5vw,2.4rem); line-height: 1.2; letter-spacing: -.055em; word-break: keep-all; }
.auth-intro { margin: 11px 0 20px; color: var(--muted); line-height: 1.6; word-break: keep-all; }
.auth-intro strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 17px; margin: 0 0 19px; padding: 0 0 17px; border-bottom: 1px solid var(--line); list-style: none; }
.auth-steps li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .81rem; font-weight: 750; }
.auth-steps li span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--soft-surface); }
.auth-steps li[aria-current] { color: var(--ink); }
.auth-steps li[aria-current] span { color: #fff; background: #535353; border-color: #535353; }
.auth-steps .complete span { color: var(--accent); }
.auth-notice { margin: 0 0 16px; padding: 11px 13px; background: var(--soft-surface); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; }
.auth-connected { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 10px; }
.auth-content a:hover, .auth-text-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-content p a { color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.auth-form, .auth-grid { display: grid; gap: 15px; }
.auth-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.auth-grid.auth-stack { grid-template-columns: 1fr; }
.auth-field { display: grid; align-content: start; min-width: 0; gap: 6px; }
.auth-field label, .auth-photo label { font-size: .91rem; font-weight: 800; }
.auth-field label small, .auth-photo label small { padding-inline-start: 5px; color: var(--muted); font-size: .77rem; font-weight: 500; }
.auth-field input, .auth-field select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); transition: border-color .15s; }
.auth-field input:hover, .auth-field select:hover { border-color: var(--accent); }
.auth-field input:focus, .auth-field select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-field small, .auth-photo p, .auth-helper { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.auth-field input::placeholder { color: var(--muted); opacity: .87; }
.auth-password { position: relative; }
.auth-password input { padding-inline-end: 45px; }
.auth-password input::-ms-reveal { display: none; }
.auth-eye { display: grid; position: absolute; inset: 0 2px 0 auto; place-items: center; width: 41px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--accent); }
.auth-eye .eye-slash { display: none; }
.auth-eye[aria-pressed="true"] .eye-slash { display: inline; }
.auth-recovery { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft-surface); }
.auth-recovery h2 { margin: 0; font-size: .95rem; }
.auth-recovery p { margin: 5px 0 12px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.auth-photo { display: grid; grid-template-columns: 62px minmax(0,1fr); align-items: center; gap: 13px; }
.auth-photo p { margin: 2px 0 5px; }
.auth-photo-preview { display: grid; place-items: center; width: 62px; height: 62px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--soft-surface); color: var(--accent); font-size: 1.7rem; }
.auth-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.auth-photo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.auth-photo input:focus-visible + .auth-photo-controls label { outline: 3px solid var(--accent); outline-offset: 2px; }
.auth-small-button, .auth-microsoft { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: center; font-weight: 800; cursor: pointer; }
.auth-small-button { min-height: 36px; padding: 6px 11px; font-size: .86rem; }
.auth-microsoft { width: 100%; min-height: 49px; padding: 9px 15px; }
.auth-small-button:hover, .auth-microsoft:hover { border-color: var(--accent); background: var(--soft-surface); }
.auth-check { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 36px; color: var(--muted); font-size: .88rem; cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin: 0; accent-color: #535353; }
.auth-text-action { justify-self: start; border: 0; padding: 3px 0; background: transparent; color: var(--accent); font-size: .84rem; font-weight: 750; text-align: left; }
.auth-primary { display: grid; place-items: center; min-height: 49px; padding: 11px 18px; border: 1px solid #535353; border-radius: 9px; background: #535353; color: #fff; font-weight: 850; text-align: center; transition: background .18s ease, box-shadow .18s ease; }
.auth-primary:hover:not(:disabled) { background: #424242; box-shadow: 0 4px 14px #3e3e3e41; }
.auth-switch { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; line-height: 1.6; }
.auth-switch a { margin-inline-start: 5px; }
.auth-connections { display: grid; gap: 10px; }
.auth-helper { margin: 0; }
.microsoft-icon { display: grid; width: 18px; height: 18px; grid-template-columns: repeat(2,1fr); gap: 2px; }
.microsoft-icon i:first-child { background: #f25022; }
.microsoft-icon i:nth-child(2) { background: #7fba00; }
.microsoft-icon i:nth-child(3) { background: #00a4ef; }
.microsoft-icon i:nth-child(4) { background: #ffb900; }
.auth-message { margin: 0; padding: 9px 11px; border-radius: 7px; background: var(--soft-surface); color: var(--ink); font-size: .84rem; line-height: 1.55; overflow-wrap: anywhere; }
.auth-message.error { background: #fff2f2; color: #902f49; }
.auth-email-time { color: var(--muted); font-size: .85rem; }
.auth-email-time strong { font-variant-numeric: tabular-nums; color: var(--accent); }
.auth-otp { font-size: 1.35rem; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.auth-callback-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: stretch; }
html[data-theme="night"] .auth-message.error { color: #ffd8e6; background: #502439; }

@container (max-width: 790px) {
  .auth-layout { grid-template-columns: minmax(0,1fr); width: min(555px,calc(100% - 32px)); margin: 19px auto 30px; border-radius: 16px; }
  .auth-landscape { min-height: 142px; justify-content: end; padding: 17px 21px; background-position: 50% 47%; }
  .auth-brand { position: absolute; top: auto; transform: translateY(-48px); font-size: 0; }
  .auth-brand img { width: 31px; height: 31px; border-radius: 9px; }
  .auth-landscape-copy span, .auth-landscape-copy p { display: none; }
  .auth-landscape-copy h2 { font-size: 1.65rem; margin: 0; }
  .auth-back { margin-bottom: 15px; }
  .auth-content { padding: 23px clamp(16px,4.1vw,26px) 27px; }
  .auth-field input, .auth-field select { font-size: 16px; }
}

@container (max-width: 460px) {
  .auth-grid { grid-template-columns: minmax(0,1fr); }
  .auth-layout { width: calc(100% - 24px); }
  .auth-steps { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-primary, .auth-field input, .auth-field select { transition: none; }
}
