/* Sign in / create account card: a slanted dark panel sweeps across the card when you switch between the two.
   Used on the customer site (login + sign up) and on the admin login. Colours come from the site's theme. */
.auth2__card {
  --a2-night: var(--night, #13294B); --a2-honey: var(--honey, #F5B700); --a2-lagoon: var(--lagoon, #0E6A70);
  --a2-paper: #FBF8F2; --a2-ink: var(--text, #1C2733); --a2-muted: #6A7580; --a2-err: #B3402E;
  --a2-ease: cubic-bezier(.76, 0, .24, 1); --a2-dur: .85s;
  position: relative; isolation: isolate; overflow: hidden; max-width: 980px; min-height: 740px; margin: 0 auto;
  background: var(--a2-paper); color: var(--a2-ink); border-radius: var(--r-box, 18px);
  box-shadow: 0 34px 60px -34px rgba(19, 41, 75, .55), 0 0 0 1px rgba(19, 41, 75, .06);
  animation: a2-card-in .7s var(--a2-ease) both;
}
.auth2--single { min-height: 520px; }

/* the sweeping panel */
.auth2__blade, .auth2__edge {
  position: absolute; top: 0; bottom: 0; left: 44%; width: 56%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 16% 100%);
  transition: left var(--a2-dur) var(--a2-ease), clip-path var(--a2-dur) var(--a2-ease);
}
.auth2__blade { z-index: 1; background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--a2-lagoon) 55%, var(--a2-night)) 0%, var(--a2-night) 62%, color-mix(in srgb, var(--a2-night) 70%, #000) 100%); }
.auth2__blade::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 20% 100%, rgba(255, 255, 255, .06), transparent 70%); }
.auth2__edge { z-index: 0; background: var(--a2-honey); clip-path: polygon(0 0, calc(100% + 0px) 0, 100% 100%, calc(16% - 3px) 100%); }
.auth2__card[data-mode="register"] .auth2__blade { left: 0; clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%); }
.auth2__card[data-mode="register"] .auth2__edge { left: 0; clip-path: polygon(0 0, 100% 0, calc(84% + 3px) 100%, 0 100%); }

/* welcome text that sits on the panel */
.auth2__welcome {
  position: absolute; z-index: 2; top: 50%; width: 32%; color: #fff;
  opacity: 0; transform: translateY(calc(-50% + 16px)); pointer-events: none;
  transition: opacity .45s ease, transform .7s var(--a2-ease);
}
.auth2__welcome--login { right: 7%; }
.auth2__welcome--register { left: 7%; }
.auth2__card[data-mode="login"] .auth2__welcome--login,
.auth2__card[data-mode="register"] .auth2__welcome--register { opacity: 1; transform: translateY(-50%); transition-delay: .35s; }
.auth2__kicker { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--a2-honey); }
.auth2__welcome h2 { margin: 0 0 14px; color: #fff; font: 400 clamp(30px, 3.4vw, 44px)/1.08 var(--display, Georgia, serif); }
.auth2__welcome h2 em { display: block; font-style: italic; color: color-mix(in srgb, var(--a2-honey) 55%, #fff); }
.auth2__welcome p:not(.auth2__kicker) { margin: 0; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .78); }

/* the two forms */
.auth2__stage { display: contents; }
.auth2__pane {
  position: absolute; top: 0; bottom: 0; z-index: 2; width: 46%; padding: 44px 44px 36px;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s ease, transform .6s var(--a2-ease), visibility 0s linear .6s;
}
.auth2__pane--login { left: 0; transform: translateX(-34px); }
.auth2__pane--register { right: 0; transform: translateX(34px); }
.auth2__pane.is-active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .5s ease .35s, transform .7s var(--a2-ease) .3s, visibility 0s; }
.auth2--single .auth2__pane { width: 50%; }

.auth2__title { margin: 0 0 6px; font: 700 26px/1.15 var(--body, system-ui); color: var(--a2-night); }
.auth2__title::after { content: ""; display: block; width: 38px; height: 3px; margin-top: 10px; background: var(--a2-honey); transform-origin: left; transform: scaleX(0); }
.auth2__pane.is-active .auth2__title::after { animation: a2-line .6s var(--a2-ease) .55s both; }
.auth2__lead { margin: 12px 0 0; font-size: 14px; color: var(--a2-muted); }
.auth2__form { margin-top: 22px; }
.auth2__err { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #FDECEA; color: #8A1C12; font-size: 14px; font-weight: 600; }
.auth2__note { margin: 14px 0 0; font-size: 12.5px; color: var(--a2-muted); line-height: 1.5; }
.auth2__note a, .auth2__links a { color: var(--a2-night); font-weight: 700; text-decoration-color: var(--a2-honey); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.auth2__links { margin: 18px 0 0; font-size: 14px; color: var(--a2-muted); }
.auth2__forgot { display: inline-block; margin: -8px 0 4px; font-size: 13px; font-weight: 600; }

/* underline fields with a floating label */
.afield { position: relative; margin: 0 0 20px; }
.auth2__card .afield input {
  width: 100%; padding: 22px 34px 8px 0; margin: 0; min-height: 0; border: 0; border-bottom: 1.5px solid rgba(19, 41, 75, .22); border-radius: 0;
  background: transparent; font: inherit; font-size: 16px; color: var(--a2-ink); outline: 0; box-shadow: none;
}
.afield label { position: absolute; left: 0; top: 21px; color: var(--a2-muted); font-size: 15px; pointer-events: none; transform-origin: left top; transition: transform .22s ease, color .22s ease; }
.auth2__card .afield input:focus + label, .auth2__card .afield input:not(:placeholder-shown) + label, .auth2__card .afield input:-webkit-autofill + label { transform: translateY(-17px) scale(.78); color: color-mix(in srgb, var(--a2-honey) 60%, #6a4a00); font-weight: 700; }
.afield__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--a2-honey); transform: scaleX(0); transform-origin: left; transition: transform .38s var(--a2-ease); }
.auth2__card .afield input:focus ~ .afield__bar { transform: scaleX(1); }
.afield__icon { position: absolute; right: 2px; top: 22px; width: 20px; height: 20px; color: var(--a2-muted); display: grid; place-items: center; transition: color .2s, transform .3s var(--a2-ease); }
.auth2__card .afield input:focus ~ .afield__icon { color: var(--a2-night); transform: scale(1.12); }
.afield__icon svg { width: 18px; height: 18px; display: block; }
button.afield__icon { border: 0; background: none; padding: 0; cursor: pointer; }
button.afield__icon:focus-visible { outline: 2px solid var(--a2-honey); outline-offset: 2px; border-radius: 4px; }
.afield__icon .afield__eye-off { display: none; }
.afield.is-shown .afield__icon .afield__eye { display: none; }
.afield.is-shown .afield__icon .afield__eye-off { display: block; }
.auth2__card .afield--error input { border-bottom-color: var(--a2-err); }
.afield__msg { margin: 6px 0 0; font-size: 12.5px; color: var(--a2-muted); }
.afield--error .afield__msg { color: var(--a2-err); font-weight: 600; }
.auth2__pane.is-active .afield, .auth2__pane.is-active .auth2__forgot, .auth2__pane.is-active .abtn, .auth2__pane.is-active .auth2__links, .auth2__pane.is-active .auth2__note {
  animation: a2-field-in .6s var(--a2-ease) both; animation-delay: calc(var(--i, 1) * 70ms + 420ms);
}
.afield:nth-of-type(1) { --i: 1; } .afield:nth-of-type(2) { --i: 2; } .afield:nth-of-type(3) { --i: 3; } .afield:nth-of-type(4) { --i: 4; } .afield:nth-of-type(5) { --i: 5; }
.auth2__pane .abtn { --i: 6; } .auth2__pane .auth2__links { --i: 7; } .auth2__pane .auth2__note { --i: 7; } .auth2__forgot { --i: 3; }

/* button */
.abtn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; margin-top: 8px; padding: 0 22px; border: 0; border-radius: var(--r-btn, 999px);
  background: var(--a2-night); color: #fff; font: 700 16px/1 var(--body, system-ui); cursor: pointer;
  transition: transform .2s var(--a2-ease), box-shadow .3s ease, background .3s ease;
}
.abtn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .22) 50%, transparent 80%); transform: translateX(-120%); }
.abtn:hover { box-shadow: 0 12px 22px -12px rgba(19, 41, 75, .7); transform: translateY(-2px); }
.abtn:hover::before { transform: translateX(120%); transition: transform .7s ease; }
.abtn:active { transform: translateY(0) scale(.98); }
.abtn:focus-visible { outline: 3px solid var(--a2-honey); outline-offset: 3px; }
.abtn.is-busy { pointer-events: none; }
.abtn.is-busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: a2-spin .7s linear infinite; }

/* wrong details: the card gives a short shake */
.auth2__card.is-shaking { animation: a2-shake .5s ease both; }

@keyframes a2-card-in { from { opacity: 0; transform: translateY(26px) scale(.985); } }
@keyframes a2-field-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes a2-line { to { transform: scaleX(1); } }
@keyframes a2-spin { to { transform: rotate(360deg); } }
@keyframes a2-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* phones and small tablets: the panel becomes a banner on top, and the two forms trade places in the same spot */
@media (max-width: 819px) {
  .auth2__card { min-height: 0; display: flex; flex-direction: column; }
  .auth2__blade, .auth2__edge { position: relative; left: 0 !important; width: 100%; height: 170px; flex: none; transition: clip-path var(--a2-dur) var(--a2-ease); clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%); }
  .auth2__edge { display: none; }
  .auth2__card[data-mode="register"] .auth2__blade { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 82%); }
  .auth2__welcome { top: 0; width: auto; left: 24px !important; right: 24px !important; height: 170px; display: flex; flex-direction: column; justify-content: center; transform: translateY(12px); }
  .auth2__card[data-mode="login"] .auth2__welcome--login, .auth2__card[data-mode="register"] .auth2__welcome--register { transform: none; }
  .auth2__welcome h2 { font-size: 30px; margin-bottom: 8px; } .auth2__welcome h2 em { display: inline; }
  .auth2__welcome p:not(.auth2__kicker) { display: none; } .auth2__kicker { margin-bottom: 8px; }
  .auth2__stage { display: grid; }
  .auth2__pane, .auth2--single .auth2__pane { position: relative; grid-area: 1 / 1; width: 100%; padding: 22px 22px 28px; justify-content: flex-start; }
  .auth2__pane--login { transform: translateX(-26px); } .auth2__pane--register { transform: translateX(26px); }
}
@media (prefers-reduced-motion: reduce) { .auth2__card, .auth2__card * { transition: none !important; animation: none !important; } .auth2__pane { transition: none !important; } }

/* admin sign-in */
.auth2--admin { padding: 6vh 16px 0; }
.auth2--admin .auth2__card { max-width: 900px; }
.auth2--admin .afield input { padding-top: 24px; }
.auth2--admin h1.auth2__title { font-size: 26px; }

.auth2__check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 2px; font-size: 13.5px; line-height: 1.45; color: var(--a2-night); }
.auth2__check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--a2-night); }
.auth2__check.has-error { color: #8A1C12; }
