/* Sign in / sign up pages */
body { background: #fff; }
.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth-side { position: relative; background: var(--xv-charcoal); color: #fff; overflow: hidden; }
.auth-side .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-side .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,42,55,.88) 0%, rgba(31,42,55,.55) 45%, rgba(31,42,55,.92) 100%); }
.auth-side .inner { position: sticky; top: 0; height: 100vh; min-height: 560px; padding: 2.6rem 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .logo img { height: 46px; width: auto; }
.auth-side h2 { color: #fff; font-size: clamp(2.2rem, 3.6vw, 3.4rem); margin-bottom: 1rem; }
.auth-side p { color: #d6dde6; font-size: 1.15rem; max-width: 26em; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; }
.auth-points li { display: flex; gap: .7rem; align-items: flex-start; color: #fff; font-weight: 500; margin-bottom: .8rem; }
.auth-points .material-symbols-outlined { color: var(--xv-copper-light); font-size: 22px; flex: none; margin-top: .1rem; }
.auth-side .copy { color: #98a4b3; }

.auth-main { position: relative; background: var(--xv-paper); display: flex; flex-direction: column; min-height: 100vh; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.4rem 2rem; font-size: .95rem; }
.auth-top a { color: var(--xv-slate); font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.auth-top a:hover { color: var(--xv-copper-dark); }
.auth-box { width: 100%; max-width: 500px; margin: 0 auto; padding: 1rem 1.5rem 3.5rem; flex: 1; }
.auth-head { margin-bottom: 1.8rem; }
.auth-head h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); margin-bottom: .6rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--xv-slate); margin-bottom: 1.2rem; }
.back-link:hover { color: var(--xv-copper-dark); }
.auth-alt { text-align: center; margin: 2rem 0 0; color: var(--xv-muted); }
.auth-box .form-control, .auth-box .form-select { padding: .85rem 1rem; }
.auth-box .input-group-text { background: var(--xv-cream); border: 1px solid #aeb6c1; border-right: 0; font-weight: 700; color: var(--xv-charcoal); border-radius: var(--xv-radius) 0 0 var(--xv-radius); }
.auth-box .input-group .form-control { border-radius: 0 var(--xv-radius) var(--xv-radius) 0; }
.opt { font-weight: 500; color: #8995a5; font-size: .85rem; margin-left: .3rem; }
.auth-box textarea { resize: vertical; }
.auth-box .btn-lg { padding: 1rem 1.4rem; font-size: 1.05rem; }
.auth-box .form-control.is-invalid, .was-validated .form-control:invalid, .was-validated .form-select:invalid { border-color: #b3261e; }
.auth-box .form-check-label { color: var(--xv-muted); font-size: .98rem; }

/* segmented controls */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--xv-cream); padding: 4px; border-radius: 6px; margin-bottom: 1.6rem; gap: 4px; }
.seg label { margin: 0; cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem .5rem; border-radius: 4px; font-weight: 600; color: var(--xv-slate); transition: background .15s, color .15s; text-align: center; }
.seg input:checked + span { background: #fff; color: var(--xv-charcoal); box-shadow: 0 1px 0 rgba(31,42,55,.14), 0 0 0 1px var(--xv-line); }
.seg input:focus-visible + span { outline: 2px solid var(--xv-copper); outline-offset: 1px; }
.seg .material-symbols-outlined { font-size: 22px; color: var(--xv-copper-dark); }
.seg-sm { margin-bottom: 1.2rem; }
.seg-sm span { padding: .6rem .4rem; font-size: .95rem; }

/* role picker */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 2rem; }
.role-card { text-align: left; background: #fff; border: 1px solid #c9c2b8; border-radius: var(--xv-radius); padding: 1.1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .15rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative; color: var(--xv-charcoal); }
.role-card .material-symbols-outlined { color: var(--xv-copper-dark); font-size: 28px; margin-bottom: .5rem; }
.role-card b { font-size: 1.05rem; letter-spacing: -.01em; }
.role-card small { color: var(--xv-muted); line-height: 1.35; }
.role-card:hover { border-color: var(--xv-charcoal); }
.role-card.on { border-color: var(--xv-charcoal); box-shadow: 0 4px 0 0 rgba(31,42,55,.12); }
.role-card.on::after { content: 'check'; font-family: 'Material Symbols Outlined'; position: absolute; right: .8rem; top: .8rem; width: 24px; height: 24px; display: grid; place-items: center; background: var(--xv-copper); color: #fff; border-radius: 50%; font-size: 17px; }

/* password */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 3.2rem; }
.pw-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px; border: 0; background: transparent; color: var(--xv-slate); display: grid; place-items: center; border-radius: var(--xv-radius); }
.pw-toggle:hover { background: var(--xv-cream); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: .6rem; }
.pw-meter i { height: 4px; border-radius: 2px; background: #ddd5ca; transition: background .2s; }
.pw-meter[data-s="1"] i:nth-child(-n+1) { background: #c8442f; }
.pw-meter[data-s="2"] i:nth-child(-n+2) { background: #d98a2b; }
.pw-meter[data-s="3"] i:nth-child(-n+3) { background: #b9a22e; }
.pw-meter[data-s="4"] i { background: #2f8f5b; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-opt { margin: 0; cursor: pointer; position: relative; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-block; padding: .5rem .95rem; border: 1px solid #aeb6c1; border-radius: 999px; background: #fff; font-weight: 600; font-size: .95rem; color: var(--xv-slate); transition: all .12s; user-select: none; }
.chip-opt:hover span { border-color: var(--xv-charcoal); }
.chip-opt input:checked + span { background: var(--xv-charcoal); border-color: var(--xv-charcoal); color: #fff; }
.chip-opt input:focus-visible + span { outline: 2px solid var(--xv-copper); outline-offset: 2px; }

/* technician stepper */
.steps-bar { margin-bottom: 1.8rem; }
.steps-bar .bar { height: 6px; border-radius: 3px; background: #e2d9cd; overflow: hidden; }
.steps-bar .bar i { display: block; height: 100%; background: var(--xv-copper); width: 25%; transition: width .3s ease; }
.steps-label { display: flex; justify-content: space-between; margin-top: .6rem; font-size: .95rem; color: var(--xv-muted); }
.steps-label b { color: var(--xv-charcoal); }
fieldset.step { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.step[hidden] { display: none; }
.step-actions { display: flex; gap: .7rem; margin-top: 2rem; }
.step-actions .btn { padding: 1rem 1.4rem; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border: 1px solid #c9c2b8; border-radius: var(--xv-radius); padding: .9rem 1rem; }
.switch-row small { display: block; color: var(--xv-muted); }
.switch { position: relative; width: 50px; height: 28px; flex: none; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #c9c2b8; border-radius: 999px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--xv-copper); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 2px solid var(--xv-charcoal); outline-offset: 2px; }
.photo-up { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid #c9c2b8; border-radius: var(--xv-radius); padding: 1rem; }
.photo-up img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; border: 1px solid var(--xv-line); }
.photo-up small { display: block; color: var(--xv-muted); line-height: 1.35; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .1rem; padding: 1.2rem .8rem; border: 1.5px dashed #a9a094; border-radius: var(--xv-radius); background: #fff; cursor: pointer; height: 100%; margin: 0; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--xv-copper); background: var(--xv-cream); }
.drop .material-symbols-outlined { color: var(--xv-copper-dark); font-size: 28px; }
.drop small { color: var(--xv-muted); word-break: break-word; }
.drop.has small { color: var(--xv-charcoal); font-weight: 600; }

/* OTP + success */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.otp input { text-align: center; font-size: 1.6rem; font-weight: 700; padding: .8rem 0; border: 1px solid #aeb6c1; border-radius: var(--xv-radius); width: 100%; min-width: 0; background: #fff; color: var(--xv-charcoal); }
.otp input:focus { border-color: var(--xv-copper); outline: 2px solid rgba(184,115,51,.35); }
.auth-ok { text-align: center; padding: 1rem 0 0; }
.auth-ok.left { text-align: left; padding: 0 0 1.4rem; }
.auth-ok h2 { font-size: 2rem; margin: 1rem 0 .6rem; }
.auth-ok.left .ok-ic { margin: 0; }
.ok-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--xv-charcoal); color: var(--xv-copper-light); display: inline-grid; place-items: center; }
.ok-ic .material-symbols-outlined { font-size: 32px; }
.auth-ok .ref { background: #fff; border: 1px dashed #a9a094; border-radius: var(--xv-radius); padding: .9rem; margin: 1.4rem 0; color: var(--xv-muted); }
.auth-ok .ref b { display: block; font-size: 1.9rem; color: var(--xv-copper-dark); letter-spacing: -.02em; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--xv-copper-dark); font-weight: 600; text-decoration: underline; }
.auth-demo { display: flex; gap: .6rem; align-items: flex-start; background: var(--xv-cream); border-radius: var(--xv-radius); padding: .9rem 1rem; margin-top: 1rem; font-size: .95rem; color: var(--xv-slate); }
.auth-demo .material-symbols-outlined { color: var(--xv-copper-dark); font-size: 22px; flex: none; }

/* tablet and phone */
@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: 0; }
  .auth-side .inner { position: relative; height: auto; min-height: 0; padding: 1.3rem 1.5rem 1.6rem; gap: 1.1rem; }
  .auth-side .pitch p, .auth-points, .auth-side .copy { display: none; }
  .auth-side h2 { font-size: 1.9rem; margin: 0; }
  .auth-side .logo img { height: 38px; }
  .auth-main { min-height: 0; }
  .auth-top { padding: 1rem 1.5rem; }
  .auth-box { padding-top: 1.6rem; }
}
@media (max-width: 575.98px) {
  .auth-top .help { display: none; }
  .auth-box { padding: 1.4rem 1.1rem 3rem; }
  .role-pick { grid-template-columns: 1fr; }
  .role-card { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: .8rem; padding: .9rem 1rem; }
  .role-card .material-symbols-outlined { margin: 0; }
  .role-card small { flex-basis: 100%; padding-left: 2.2rem; }
  .role-card.on::after { top: .9rem; }
  .otp { gap: .35rem; }
  .otp input { font-size: 1.3rem; }
  .step-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(251,248,244,0), var(--xv-paper) 30%); padding: 1rem 0 .6rem; margin-top: 1.2rem; }
}
.auth-side .logo { display: inline-block; align-self: flex-start; background: var(--xv-charcoal); padding: .55rem .9rem; border-radius: var(--xv-radius); line-height: 0; }
.auth-side .logo img { height: 40px; }
@media (max-width: 991.98px) { .auth-side .logo img { height: 34px; } .auth-side .logo { padding: .45rem .75rem; } }

/* desktop: photo column is fixed, only the form column scrolls */
@media (min-width: 992px) {
  html, body { height: 100%; overflow: hidden; }
  .auth { height: 100vh; min-height: 0; overflow: hidden; }
  .auth-side { height: 100vh; }
  .auth-side .inner { position: relative; height: 100%; min-height: 0; }
  .auth-main { height: 100vh; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
  .auth-top { position: sticky; top: 0; z-index: 5; background: var(--xv-paper); }
}
@media (min-width: 992px) and (prefers-reduced-motion: reduce) { .auth-main { scroll-behavior: auto; } }
.auth-err { background: #fdecea; color: #8c2a1c; border-left: 3px solid #b3352a; padding: .7rem .9rem; border-radius: 4px; font-size: .92rem; margin: 0 0 1rem; }
.srv-err.invalid-feedback { margin-top: .35rem; }
