/* auth.css · AUTHDS: shared layout + new compositions for the auth pages.
   Built on ez42-ui.css v4 tokens only. New compositions: ez-auth, ez-auth__icon, ez-pass.
   AUTHFIT: every auth page fits the viewport without scrolling (desktop >= 600px tall, phones >= 640px):
   one centred card, the top bar and footer live inside it, art beside the form on wide screens,
   two columns for long pages, and compact rules on short screens. Page scroll stays as a fallback. */

.ez-auth-body { margin: 0; background: var(--bg); }
.ez-auth { position: relative; background: var(--bg); color: var(--text); font-family: var(--font-sans);
  font-size: var(--fs-body); line-height: var(--lh-body); }
.ez-auth__main { min-block-size: 100vh; min-block-size: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box; }

/* card */
.ez-auth__card { position: relative; display: flex; flex-direction: column; inline-size: 100%; max-inline-size: 480px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden; }
.ez-auth__card--mid { max-inline-size: 540px; }
.ez-auth__card--art { max-inline-size: 960px; }
.ez-auth__card--art .ez-auth__body { max-inline-size: 560px; }
.ez-auth__card--wide { max-inline-size: 920px; }
.ez-auth__strip { position: absolute; inset-block-start: 0; inset-inline: 0; block-size: 4px; background: var(--transition-strip); z-index: 2; }
.ez-auth__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--space-3); min-inline-size: 0;
  padding: clamp(16px, 2.6vw, 32px); padding-block-start: 14px; }
.ez-auth__body form { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }

/* top bar inside the card: logo (home) · extra link · language */
.ez-auth__top { display: flex; align-items: center; gap: var(--space-2); min-block-size: var(--tap-min); margin-block-end: -4px; }
.ez-auth__logo { display: inline-flex; border-radius: var(--radius-circle); margin-inline-end: auto; }
.ez-auth__logo img { display: block; inline-size: 34px; block-size: 34px; }
.ez-auth__toplink { font-size: var(--fs-body-sm); padding-inline: var(--space-3); }
.ez-auth .ez-auth__toplink { inline-size: auto; flex: 0 0 auto; } /* DS makes every .ez-btn 100% wide under 480px */

/* two columns for long pages (wide screens) */
.ez-auth__cols { display: flex; flex-direction: column; gap: var(--space-3); }
.ez-auth__col { display: flex; flex-direction: column; gap: var(--space-3); min-inline-size: 0; }

/* art (login + signup 1): beside the form on wide screens, a short banner on tall narrow screens */
.ez-auth__art { position: relative; flex: 0 0 auto; aspect-ratio: 1024 / 300; overflow: hidden; background: var(--navy); }
.ez-auth__art-img { position: absolute; inset: -10px; background: url('/static/files/images-general/login.jpg') center 40% / cover no-repeat; filter: blur(0.3px); }
.ez-auth__art-veil { position: absolute; inset: 0; background: linear-gradient(to top, var(--navy) 0%, transparent 70%); }
.ez-auth__art-text { position: absolute; inset-inline: 0; inset-block-end: 0; display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-4) clamp(16px, 3vw, 32px); color: var(--on-brand); }
.ez-auth__art-title { margin: 0; font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 800; line-height: 1.2; color: var(--on-brand); }
.ez-auth__art-sub { margin: 0; font-size: var(--fs-body-sm); color: var(--on-brand); opacity: 0.9; }

@media (min-width: 880px) {
  .ez-auth__card--art { flex-direction: row; }
  .ez-auth__card--art .ez-auth__art { aspect-ratio: auto; flex: 0 0 42%; }
  .ez-auth__card--art .ez-auth__art-img { background-position: 38% center; }
  .ez-auth__card--art .ez-auth__body { flex: 1 1 58%; max-inline-size: none; }
  .ez-auth__cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: start; }
}
@media (max-width: 879px) and (max-height: 820px) {
  .ez-auth__art { display: none; }
}

/* titles */
.ez-auth__titles { display: flex; flex-direction: column; gap: 2px; }
.ez-auth__titles--center { align-items: center; text-align: center; }
.ez-auth__titles .ez-caption { margin: 0; line-height: 1.5; }
.ez-auth__titles .ez-h2 { line-height: 1.25; }

/* compact form controls (still >= 44px) */
.ez-auth .ez-field { gap: 4px; }
.ez-auth .ez-input, .ez-auth .ez-native-select { padding-block: 0.55rem; line-height: 1.4; }
.ez-auth .ez-btn { padding-block: 0.7rem; }
.ez-auth .ez-callout { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
.ez-auth .ez-callout__text { line-height: 1.5; }
.ez-auth .ez-alert { padding-block: var(--space-2); }
.ez-auth__moe .ez-callout__text { font-size: var(--fs-footnote); }

/* footer links (bottom of the card) */
.ez-auth__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-4); margin-block-start: auto; }
.ez-auth__foot a { display: inline-flex; align-items: center; min-block-size: 32px; font-size: var(--fs-footnote); color: var(--text-muted); }

/* shared bits */
.ez-auth__stack { display: flex; flex-direction: column; gap: var(--space-2); }
.ez-auth__row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ez-auth__row > * { flex: 1 1 160px; }
.ez-auth__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.ez-auth__divider { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: var(--fs-body-sm); line-height: 1; }
.ez-auth__divider::before, .ez-auth__divider::after { content: ""; flex: 1; block-size: 1px; background: var(--border); }
.ez-auth__alt { margin: 0; text-align: center; font-size: var(--fs-body-sm); color: var(--text-soft); line-height: 1.5; }
.ez-auth__alt a { font-weight: var(--fw-bold); }
.ez-auth__text { margin: 0; font-size: var(--fs-body-sm); color: var(--text-soft); line-height: 1.6; }
.ez-auth__fine { margin: 0; text-align: center; font-size: var(--fs-footnote); color: var(--text-muted); line-height: 1.5; }
.ez-auth__label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ez-auth__label-row a { display: inline-flex; align-items: center; min-block-size: var(--tap-min); margin-block: -12px; font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); }
.ez-auth__pw { position: relative; }
.ez-auth__pw .ez-input { padding-inline-end: 52px; }
.ez-auth__eye { position: absolute; inset-block-start: 50%; inset-inline-end: 2px; transform: translateY(-50%); color: var(--text-muted); }
.ez-auth__sso img { inline-size: 20px; block-size: 20px; }
.ez-auth__hidden { display: none !important; }
.ez-auth__pill { display: inline-flex; align-self: center; gap: var(--space-1); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill); background: var(--border-soft); font-size: var(--fs-body-sm); color: var(--text-soft); }
.ez-auth__list { list-style: none; margin: 0; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1);
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); }
.ez-auth__list--plain { padding: 0; background: none; border: 0; }
.ez-auth__list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--fs-body-sm); line-height: 1.5; }
.ez-auth__list .ez-icon { color: var(--purple-dark); margin-block-start: 0.15rem; }
.ez-auth__list--ok .ez-icon { color: var(--success-text); }
.ez-auth__heroes { display: flex; flex-wrap: nowrap; justify-content: center; gap: var(--space-2); }
.ez-auth__heroes img { inline-size: clamp(36px, 10vw, 64px); block-size: auto; min-inline-size: 0; }
.ez-auth__heroes--grey img { filter: grayscale(1); opacity: 0.85; }
.ez-auth__caption { margin: 0; text-align: center; font-size: var(--fs-footnote); color: var(--text-muted); }
.ez-auth__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--space-2); }
.ez-auth__options .ez-option { flex-direction: column; justify-content: center; gap: var(--space-1); padding: var(--space-2);
  text-align: center; font-size: var(--fs-body-sm); line-height: 1.3; min-block-size: 64px; }
.ez-auth__options .ez-option .ez-icon { color: var(--purple-dark); }
.ez-auth__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ez-auth__chips .ez-chip { min-block-size: var(--tap-min); }
.ez-auth fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; display: flex; flex-direction: column; gap: 4px; }
.ez-auth legend { padding: 0; margin-block-end: 4px; }
.ez-auth__quote { margin: 0; font-size: var(--fs-body-sm); font-style: italic; color: var(--text-soft); text-align: center; line-height: 1.5; }

/* status icon (new) */
.ez-auth__icon { inline-size: 52px; block-size: 52px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  align-self: center; border-radius: var(--radius-circle); }
.ez-auth__icon--brand { background: var(--tip-bg-from); color: var(--purple-dark); }
.ez-auth__icon--info { background: var(--info-bg); color: var(--info-text); }
.ez-auth__icon--success { background: var(--success-bg); color: var(--success-text); }
.ez-auth__icon--warn { background: var(--warn-bg); color: var(--warn-text); }
.ez-auth__icon--error { background: var(--error-bg); color: var(--error-text); }
.ez-auth__icon--neutral { background: var(--border-soft); color: var(--text-muted); border: 2px solid var(--border); }

/* password readout (new): ez-pass */
.ez-pass { position: relative; display: flex; align-items: center; justify-content: center; min-block-size: 68px;
  padding-block: var(--space-2); padding-inline: 52px; background: var(--surface-alt);
  border: 2px solid var(--border); border-radius: var(--radius-md); }
.ez-pass.is-invalid { border-color: var(--error-border); }
.ez-pass__text { font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 800; line-height: 1.2; letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); overflow: hidden; text-overflow: ellipsis; max-inline-size: 100%; }
.ez-pass__run { unicode-bidi: isolate; }
.ez-pass__run--suffix { color: var(--purple-dark); }
.ez-pass__run.is-new { display: inline-block; animation: auth-swap 340ms cubic-bezier(.16, 1, .3, 1); }
.ez-pass__edit { position: absolute; inset-inline-end: 4px; inset-block-start: 50%; transform: translateY(-50%); color: var(--text-muted); }
.ez-pass-input { font-size: 1.15rem; font-weight: var(--fw-bold); text-align: center; }
/* AUTHPASSEDIT: rule line + visible edit button on one row under the box */
.ez-pass__meta { align-items: center; }
.ez-auth .ez-pass__edit-btn { inline-size: auto; flex: 0 0 auto; min-block-size: var(--tap-min); margin-block: -10px;
  padding-inline: var(--space-2); font-size: var(--fs-body-sm); white-space: nowrap; }
@keyframes auth-swap { from { opacity: 0; transform: translateY(-40%); } to { opacity: 1; transform: none; } }

/* write-it-down callout */
.ez-auth__note { border-width: 2px; align-items: center; }
.ez-auth__note-icon { inline-size: 40px; block-size: 40px; border-radius: var(--radius-circle); display: inline-flex;
  align-items: center; justify-content: center; background: var(--warn-border); color: var(--navy); }
.ez-auth__note .ez-callout__text { font-size: var(--fs-body-sm); font-weight: var(--fw-bold); }
.ez-auth__copy.is-copied { color: var(--success-text); }

/* short screens: drop decoration first, keep every control */
@media (max-height: 760px) {
  .ez-auth__icon, .ez-auth__foot, .ez-auth [data-auth-optional] { display: none !important; }
  .ez-auth__body { gap: 10px; }
  .ez-auth__body form { gap: 10px; }
  .ez-auth__options .ez-option { padding: 6px; gap: 2px; min-block-size: 52px; }
  .ez-auth__compact .ez-callout__text { font-size: var(--fs-footnote); }
}
@media (max-height: 640px) {
  .ez-auth__main { padding: 6px; }
  .ez-auth__body { padding-block: 10px 14px; gap: 8px; }
  .ez-auth__body form { gap: 8px; }
  .ez-auth .ez-h2 { font-size: 1.35rem; }
  .ez-auth .ez-btn { padding-block: 0.6rem; }
  .ez-auth__compact { display: none !important; }
}
@media (max-width: 879px) {
  .ez-auth__note .ez-callout__text { font-weight: var(--fw-semibold); }
}
@media (max-width: 479px) {
  .ez-auth__note-icon { display: none; }
  .ez-auth__grid2 .ez-btn { padding-inline: var(--space-2); white-space: nowrap; }
}
@media (max-width: 479px) and (max-height: 760px) {
  .ez-auth__wide-only { display: none; }
}
@media (max-width: 359px) {
  .ez-auth__main { padding: 4px; }
  .ez-auth__body { padding-inline: 12px; }
  .ez-auth .ez-h2 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ez-pass__run.is-new { animation: none; }
  .ez-auth .ez-btn { transition: none; transform: none; }
}

/* AUTHFIT: the whole readout is the edit button (no visible pencil), so the password sits truly centred */
.ez-pass { cursor: text; }
.ez-pass__edit { inset: 0; inline-size: 100%; block-size: 100%; transform: none; opacity: 0; border-radius: var(--radius-md); }
.ez-pass__edit:focus-visible { opacity: 1; background: transparent; outline: 2px solid var(--focus-color); outline-offset: 2px; }
.ez-pass__edit:focus-visible .ez-icon { visibility: hidden; }