@font-face {
  font-family: 'Geist';
  src: url('../../fonts/geist/GeistVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root[data-theme] { --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif; }
html, body { min-height: 100%; }
.auth-layout {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px;
}
/* The artwork slot stays plain until the final image is supplied. */
.auth-panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-radius: 12px;
  background-color: var(--bg-surface);
}
.auth-panel-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-form-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-brand {
  position: relative;
  top: -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
/* Fit the visible artwork; the source has generous transparent margins. */
.auth-brand-logo { display: block; width: 144px; height: 80px; object-fit: cover; margin-inline: -24px; max-width: none; }
.auth-brand-accent { color: var(--brand); }
.auth-form-box {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.auth-form-title { font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; }
.auth-form-sub { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.5; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form .form-label { color: var(--text-primary); font-size: 0.875rem; line-height: 1.5; font-weight: 500; }
.auth-form .form-control { min-height: 48px; font-size: 1rem; line-height: 1.5; }
.auth-form .input-icon .form-control { padding-left: 14px; }
.auth-form .btn-primary { min-height: 48px; font-size: 0.9375rem; line-height: 1.5; border-radius: 10px; box-shadow: none; }
.auth-form .btn-primary:hover { box-shadow: none; }
.auth-form .btn-primary:disabled { opacity: 0.65; cursor: wait; }
.auth-footer { margin-top: 24px; text-align: center; font-size: 0.8125rem; line-height: 1.5; color: var(--text-secondary); }
.auth-account { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; min-width: 0; }
.auth-account-avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--bg-hover); color: var(--text-secondary); overflow: hidden; }
.auth-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-account-avatar i { font-size: 20px; }
.lock-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; line-height: 1.5; font-weight: 500; }
.lock-form .form-control { padding-right: 48px; }
.lock-error { font-size: 0.8125rem; line-height: 1.5; color: var(--text-primary); overflow-wrap: anywhere; }
.lock-error[hidden] { display: none; }
.lock-logout { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 4px; border-radius: 6px; }
.lock-logout:hover { color: var(--text-primary); background: var(--bg-hover); }
.lock-logout:active { background: var(--bg-active); }
.lock-logout:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.auth-theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
}
.auth-theme-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.auth-theme-toggle:active { transform: scale(0.96); }
.auth-graphic-left .auth-theme-toggle { left: auto; right: 20px; }
@media (min-width: 901px) and (min-height: 501px) {
  .auth-graphic-left .auth-panel { grid-column: 1; grid-row: 1; }
  .auth-graphic-left .auth-form-wrap { grid-column: 2; grid-row: 1; }
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
}
.password-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.password-toggle:active { background: var(--bg-active); }
.auth-layout button:focus-visible, .auth-theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; padding: 16px; gap: 0; }
  .auth-panel { display: none; }
  .auth-form-wrap { padding: 40px 8px 24px; }
}
@media (max-width: 480px) {
  .auth-form-box { padding: 24px 20px; }
  .auth-brand { font-size: 1.75rem; margin-bottom: 20px; }
}
/* Reduce the stack's intrinsic height instead of hiding overflowing controls. */
@media (max-height: 700px) {
  .auth-layout { padding: 12px; }
  .auth-form-wrap { padding: 24px 8px 16px; }
  .auth-brand { top: -8px; margin-bottom: 12px; font-size: 1.5rem; }
  .auth-brand-logo { width: 112px; height: 56px; margin-inline: -20px; }
  .auth-form-box { padding: 24px; }
  .auth-form-sub { margin-bottom: 20px; }
  .auth-form { gap: 16px; }
  .auth-footer { margin-top: 16px; }
  .auth-lock-box { padding: 16px; }
  .auth-lock-box .auth-form-title { font-size: 1.5rem; }
  .auth-lock-box .auth-form-sub, .auth-account { margin-bottom: 12px; }
  .auth-lock-box .auth-form { gap: 12px; }
  .auth-account-avatar { width: 32px; height: 32px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .auth-layout { grid-template-columns: 1fr; padding: 8px; }
  .auth-panel { display: none; }
  .auth-form-wrap {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(0, 420px);
    grid-template-rows: 1fr 1fr;
    column-gap: 24px;
    padding: 8px 8px 8px 56px;
  }
  .auth-brand { align-self: end; margin: 0 0 12px; }
  .auth-footer { align-self: start; margin: 0; }
  .auth-form-box { grid-column: 2; grid-row: 1 / 3; padding: 16px 20px; }
  .auth-form-title { font-size: 1.5rem; }
  .auth-form-sub { margin-bottom: 12px; }
  .auth-form { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
