/* MJK Electric — the sign-in pages: client portal sign-in (templates/website/client_login.html), staff sign-in
   (staff_login.html), staff change password (staff_change_password.html) and the four forgot-password pages
   (password_reset/). Loaded after css/home_v2.css, which supplies the tokens, nav, buttons, eyebrow, inline
   links and footer. See docs/home_v2.md. */

/* ------------------------------------------------------------ split screen */
/* the photo fills the left half of the window and the sign-in panel sits in the right half. The content is laid
   out on the page's .wrap, whose middle is the middle of the window, so the photo's edge and the columns agree */
.gate { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line); background:
    radial-gradient(760px 600px at 77% 48%, rgba(194, 124, 46, .14), transparent 64%), var(--bg-2); }
.gate__media { position: absolute; inset: 0 50% 0 0; z-index: -2; overflow: hidden; }
.gate__media picture, .gate__media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate__media img { object-fit: cover; object-position: 50% 85%; animation: heroDrift 28s var(--ease) both; transform-origin: 42% 50%; }
/* dark under the nav, dark behind the strip at the foot, and a fade into the panel's side */
.gate__media::after { content: ''; position: absolute; inset: 0; background:
    linear-gradient(180deg, rgba(9, 11, 13, .8) 0%, rgba(9, 11, 13, 0) 20%, rgba(9, 11, 13, 0) 56%, rgba(9, 11, 13, .84) 82%, rgba(9, 11, 13, .95) 100%),
    linear-gradient(90deg, rgba(13, 16, 19, 0) 70%, var(--bg-2) 100%); }
.gate__grid { position: absolute; inset: 0 0 0 50%; z-index: -1; opacity: .5; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 96px 96px; background-position: center;
    -webkit-mask-image: linear-gradient(90deg, transparent 8%, #000 100%); mask-image: linear-gradient(90deg, transparent 8%, #000 100%); }

.gate__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.gate__panel { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; justify-content: center;
    padding: calc(var(--nav-h) + clamp(24px, 4.5vh, 56px)) 0 clamp(40px, 7vh, 84px) clamp(32px, 6vw, 104px); }
.gate__panel > * { width: 100%; max-width: 500px; }
.gate__title { margin-top: clamp(14px, 1.8vw, 22px); font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(3rem, 5.2vw, 5.4rem); line-height: .92; letter-spacing: -.01em; color: #fff; }
.gate__title em { font-style: normal; background: linear-gradient(100deg, #f6c58c 0%, #e09544 40%, #b06a1f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate__lede { margin-top: clamp(12px, 1.4vw, 18px); font-size: clamp(1.02rem, 1.2vw, 1.16rem); line-height: 1.6; color: #c9c7c3; font-weight: 350; }
.gate__alt { margin-top: 24px; font-size: .96rem; color: var(--muted); }
.gate__help { margin-top: 8px; font-size: .96rem; color: var(--muted); }
.gate__help a { font-family: var(--mono); font-size: .94em; font-weight: 500; letter-spacing: .02em; color: #fff; white-space: nowrap; transition: color .2s; }
.gate__help a:hover { color: var(--copper-hi); }

.js .gate__panel > *, .js .inside { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
.js .gate__panel > :nth-child(1) { animation-delay: .05s; }
.js .gate__panel > :nth-child(2) { animation-delay: .14s; }
.js .gate__panel > :nth-child(3) { animation-delay: .24s; }
.js .gate__panel > :nth-child(4) { animation-delay: .36s; }
.js .gate__panel > :nth-child(5) { animation-delay: .5s; }
.js .gate__panel > :nth-child(6) { animation-delay: .56s; }
.js .inside { animation-delay: .7s; }

/* ---------------------------------------------------------- sign-in panel */
.signin { --pad: clamp(20px, 2.4vw, 32px); position: relative; overflow: hidden; margin-top: clamp(22px, 2.6vw, 34px); border: 1px solid var(--line-2); border-radius: 6px;
    background: linear-gradient(180deg, rgba(24, 29, 34, .92), rgba(15, 18, 22, .96));
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .5), 0 0 90px -30px rgba(226, 150, 74, .28); }
.signin::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #e9a55c, #a8651f 60%, rgba(168, 101, 31, 0)); }
.signin__head { display: flex; align-items: center; gap: 10px; padding: 20px var(--pad) 16px; border-bottom: 1px solid var(--line); color: var(--copper-hi); }
.signin__head svg { flex: none; width: 15px; height: 15px; }
.signin__head .mono { color: var(--copper-hi); }
.signin__form { display: grid; gap: 20px; padding: 24px var(--pad) var(--pad); color-scheme: dark; }

/* what the server says back after a failed sign-in (Django messages) */
.note { padding: 13px 16px; border: 1px solid var(--line-2); border-left-width: 3px; border-radius: 3px; background: rgba(255, 255, 255, .04); color: var(--text); font-size: .96rem; line-height: 1.5; }
.note--error { border-color: rgba(255, 128, 106, .6); background: rgba(196, 70, 48, .14); color: #ffd6cd; }
.note--warning { border-color: rgba(234, 168, 98, .6); background: rgba(194, 124, 46, .14); color: #f8dfc0; }

/* fields: the same treatment as the contact form (css/contact.css) */
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field input { display: block; width: 100%; height: 54px; margin: 0; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 3px; background: rgba(9, 11, 13, .62); color: #fff; font: 400 1rem/1.4 var(--body); -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.field input:hover { border-color: rgba(255, 255, 255, .3); }
.field input:focus { outline: 0; border-color: rgba(234, 168, 98, .8); background: rgba(9, 11, 13, .82); box-shadow: 0 0 0 4px rgba(194, 124, 46, .16); }
/* a browser's saved sign-in would paint the field white */
.field input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 100px #101418 inset; caret-color: #fff; }
.field input:-webkit-autofill:focus { box-shadow: 0 0 0 100px #101418 inset, 0 0 0 4px rgba(194, 124, 46, .16); }

.signin__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: .95rem; }
.check { display: inline-flex; align-items: center; gap: 10px; color: #dcd9d4; cursor: pointer; }
.check input { -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1px solid var(--line-2); border-radius: 2px; background: rgba(9, 11, 13, .62); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.check:hover input { border-color: rgba(255, 255, 255, .3); }
.check input:checked { border-color: var(--copper-hi); background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.6 7.4l2.9 2.9 5.9-6.5' fill='none' stroke='%23170f05' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat,
    linear-gradient(180deg, #d9913f, #b87327); }
.signin__go { width: 100%; margin-top: 4px; }

/* ------------------------------------------------- what is behind the door */
/* a strip along the foot of the photo, in the left column: three cells like the front page's spec strip */
.inside { grid-column: 1; grid-row: 1; align-self: end; padding: 0 clamp(24px, 4vw, 64px) clamp(32px, 5vh, 52px) 0; text-shadow: 0 1px 22px rgba(0, 0, 0, .75); }
.inside__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--line-2); }
.inside__list li { padding: 16px 20px 0; border-left: 1px solid var(--line); }
.inside__list li:first-child { padding-left: 0; border-left: 0; }
.inside__k { display: block; font-size: .66rem; font-weight: 600; letter-spacing: .14em; color: var(--copper-hi); }
.inside__v { margin-top: 5px; font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; color: #fff; }
.inside__list p { margin-top: 6px; font-size: .9rem; line-height: 1.5; color: #cfccc7; }

/* ------------------------------------- staff sign-in and forgot password */
/* the shop photo: the lamp, the bench and the racks sit in the middle band of the frame */
.gate__media--login-shop img { object-position: 50% 62%; }
/* a longer heading than "Client Portal" (Password Reset Required, Set a New Password) */
.gate__title--sm { font-size: clamp(2.5rem, 4.1vw, 4.2rem); }
.gate__title--sm em { display: block; }
.gate__email { font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.gate__alt .link-inline, .signin__foot .link-inline { text-decoration: none; }
.gate__alt .link-inline:hover, .signin__foot .link-inline:hover { text-decoration: underline; }

.signin + .gate__help { margin-top: 22px; }

.note--ok { border-color: rgba(124, 200, 146, .55); background: rgba(64, 150, 92, .14); color: #d3f0dc; }
.note p + p { margin-top: 6px; }
.note a { color: #fff; font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.field--bad input { border-color: rgba(255, 128, 106, .7); }
.field__error { font-size: .9rem; line-height: 1.45; color: #ffb4a6; }
.field__hint { font-size: .86rem; line-height: 1.5; color: var(--dim); }
.signin__form > .field__hint { margin-top: -6px; }
.signin__form input[hidden] { display: none; }
/* a panel with no form in it (link sent, link expired, password updated) */
.signin__body { display: grid; gap: 20px; padding: 24px var(--pad) var(--pad); }
.signin__head--ok, .signin__head--ok .mono { color: #9fdcb2; }
.signin__head--bad, .signin__head--bad .mono { color: #ffb4a6; }
.signin__foot { font-size: .95rem; text-align: center; }
.signin__foot--split { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; text-align: left; }
.link-inline--dim { color: var(--muted); text-decoration-color: var(--line-2); }
.link-inline--dim:hover { color: var(--text); }
.tips { padding: 16px 18px; border-left: 2px solid var(--copper); background: rgba(194, 124, 46, .08); }
.tips__title { margin-bottom: 8px; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-hi); }
.tips li { position: relative; padding-left: 22px; font-size: .95rem; line-height: 1.5; color: #dcd9d4; }
.tips li + li { margin-top: 6px; }
.tips li::before { content: ''; position: absolute; left: 0; top: .72em; width: 12px; height: 1px; background: var(--copper-hi); }

/* ------------------------------------------------------------- responsive */
/* a narrow left column has room for the three names only */
@media (min-width: 901px) and (max-width: 1199px) {
    .inside__list li { padding: 14px 14px 0; }
    .inside__v { font-size: 1.14rem; }
    .inside__list p { display: none; }
}
/* a short window (a 768-high laptop): tighten the panel so the sign-in button stays on the first screen */
@media (min-width: 901px) and (max-height: 720px) {
    .gate__panel { padding-top: calc(var(--nav-h) + 14px); padding-bottom: 36px; }
    .gate__title { margin-top: 12px; font-size: clamp(2.8rem, 4.2vw, 3.6rem); }
    .gate__lede { margin-top: 10px; }
    .signin { margin-top: 18px; }
    .signin__head { padding: 15px var(--pad) 12px; }
    .signin__form { gap: 16px; padding-top: 18px; }
    .field input { height: 48px; }
    .signin__go { min-height: 54px; }
    /* the pages with a longer heading or three fields (change password, set a new password): the heading on
       one line and a tighter form */
    .gate__title--sm { font-size: clamp(2.2rem, 3.1vw, 2.8rem); }
    .gate__title--sm em { display: inline; }
    .login--staff .signin__form:has(.field + .field + .field), .login--reset .signin__form:has(.field + .field) { gap: 12px; padding-top: 16px; padding-bottom: 20px; }
    .signin__form:has(.field + .field + .field) .field, .login--reset .signin__form:has(.field + .field) .field { gap: 6px; }
    .signin__form:has(.field + .field + .field) .field input, .login--reset .signin__form:has(.field + .field) .field input { height: 44px; }
    /* with a message in the panel (a forced change, an error) the sentence under the heading gives way to it */
    .gate__panel:has(.gate__title--sm):has(.note) .gate__lede { display: none; }
    .gate__panel:has(.gate__title--sm) .note { padding: 9px 14px; }
    .gate__panel:has(.gate__title--sm) .signin__head { padding: 12px var(--pad) 10px; }
    .gate__panel:has(.gate__title--sm) .signin__go { min-height: 50px; }
}
@media (max-width: 900px) {
    /* one column: the photo sits behind the heading, then the panel, then the list */
    .gate { background: var(--bg-2); }
    .gate__media { inset: 0 0 auto 0; height: 440px; }
    .gate__media img { object-position: 50% 46%; }
    .gate__media--login-shop img { object-position: 50% 58%; }
    .gate__media::after { background: linear-gradient(180deg, rgba(9, 11, 13, .82) 0%, rgba(9, 11, 13, .62) 34%, rgba(13, 16, 19, .86) 72%, var(--bg-2) 100%); }
    .gate__grid { display: none; }
    .gate__in { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .gate__panel, .inside { grid-column: 1; max-width: 520px; margin: 0 auto; }
    .gate__panel { padding: calc(var(--nav-h) + 40px) 0 0; }
    /* no list under the panel (staff sign-in, forgot password): the panel closes the section itself */
    .gate__panel:only-child { padding-bottom: 64px; }
    .gate__panel > * { max-width: none; }
    /* the strip becomes three rows under the panel */
    .inside { grid-row: 2; align-self: start; padding: 48px 0 72px; text-shadow: none; }
    .inside__list { grid-template-columns: minmax(0, 1fr); }
    .inside__list li, .inside__list li:first-child { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 6px; padding: 16px 0; border-left: 0; border-bottom: 1px solid var(--line); }
    .inside__k { grid-row: 1 / span 2; padding-top: 6px; }
    .inside__v { margin-top: 0; font-size: 1.38rem; letter-spacing: .02em; }
    .inside__list p { margin-top: 3px; font-size: .96rem; color: var(--muted); }
}
@media (max-width: 599px) {
    .gate__media { height: 380px; }
    .gate__panel { padding-top: calc(var(--nav-h) + 28px); }
    .login .eyebrow { letter-spacing: .14em; }
    .login .eyebrow .tick { width: 20px; }
    .signin__form { gap: 18px; padding-top: 20px; }
    .inside { padding: 40px 0 60px; }
}
/* no staggered arrival: the global rule shortens animations but keeps their delays */
@media (prefers-reduced-motion: reduce) {
    .js .gate__panel > *, .js .inside { opacity: 1; animation: none; }
}
