.sign-in { padding: 0; border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.desktop-auth-logout { display: inline-flex; margin: 0; }
.auth-user { max-width: 130px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-auth-entry { display: none; }

.auth-modal {
    position: fixed;
    inset: 124px auto auto 50%;
    width: min(1060px, calc(100vw - 40px));
    height: min(538px, calc(100dvh - 148px));
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    transform: translateX(-50%);
    border: 0;
    background: #fff;
    color: #282828;
    box-shadow: none;
}
.auth-modal::backdrop { background: rgba(0,0,0,.78); }
.auth-modal-shell { display: grid; width: 100%; height: 100%; grid-template-columns: 1fr 1fr; }
.auth-visual { min-width: 0; height: 100%; overflow: hidden; background: #fff0e7; }
.auth-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.auth-panel { position: relative; min-width: 0; height: 100%; overflow-y: auto; padding: 66px 42px 36px; background: #fff; }
.auth-close { position: absolute; z-index: 2; top: 9px; right: 9px; display: grid; width: 18px; height: 18px; place-items: center; padding: 0 0 2px; border: 0; border-radius: 0; background: #f04444; color: #fff; font-size: 17px; font-weight: 600; line-height: 1; cursor: pointer; }
.auth-state[hidden] { display: none !important; }
.auth-state h2 { margin: 0; color: #292929; font-size: 30px; font-weight: 700; line-height: 1.2; }
.auth-state[data-auth-state="register"] h2, .auth-state[data-auth-state="forgot"] h2 { font-size: 22px; }
.auth-description { margin: 8px 0 0; color: #555; font-size: 12px; line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; margin-top: 30px; }
.auth-form--compact { margin-top: 22px; }
.auth-form label { margin: 0 0 10px 8px; color: #333; font-size: 15px; line-height: 1.25; }
.auth-form > input,
.auth-password-field input { display: block; width: 100%; height: 49px; margin: 0 0 26px; padding: 0 18px; border: 1px solid #d8d8d8; border-radius: 0; outline: 0; background: #fff; color: #292929; font-size: 14px; }
.auth-state[data-auth-state="login"] #auth-login-email { margin-bottom: 26px; }
.auth-state[data-auth-state="register"] .auth-form > input,
.auth-state[data-auth-state="forgot"] .auth-form > input { margin-bottom: 22px; }
.auth-form input::placeholder { color: #777; opacity: 1; }
.auth-form input:focus { border-color: #a9a9a9; }
.auth-password-field { position: relative; margin-bottom: 12px; }
.auth-password-field input { margin: 0; padding-right: 48px; }
.auth-password-toggle { position: absolute; top: 0; right: 9px; display: grid; width: 32px; height: 49px; place-items: center; padding: 0; border: 0; background: transparent; color: #555; cursor: pointer; }
.auth-password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.auth-password-toggle .eye-slash { display: none; }
.auth-password-toggle.is-visible .eye-slash { display: block; }
.auth-forgot-link { align-self: flex-end; margin: 0 13px 31px 0; font-size: 13px; line-height: 1.3; }
.auth-submit { display: flex; width: 100%; height: 50px; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid var(--color-orange); border-radius: 0; background: var(--color-orange); color: #fff; font-size: 12px; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.auth-submit:hover:not(:disabled) { border-color: #d94e00; background: #d94e00; }
.auth-submit:disabled { cursor: wait; opacity: .7; }
.auth-switch-copy { margin: 32px 0 0; color: #444; font-size: 13px; line-height: 1.4; }
.auth-state[data-auth-state="register"] .auth-switch-copy,
.auth-state[data-auth-state="forgot"] .auth-switch-copy { margin-top: 28px; }
.auth-text-link { display: inline; padding: 0; border: 0; background: transparent; color: #333; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.auth-text-link:hover { color: var(--color-orange); }
.auth-back-login { margin-top: 12px; color: #777; font-size: 12px; }
.auth-error { display: block; margin: -17px 0 17px 8px; color: #b42318; font-size: 11px; line-height: 1.3; }
.auth-notice { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--color-orange); background: #fff7f1; color: #49413b; font-size: 12px; line-height: 1.45; }
.auth-dev-link { margin: 8px 0 0; font-size: 12px; }
.auth-dev-link a { color: var(--color-orange); text-decoration: underline; }
.auth-state.is-active { display: block; }

@media (max-width: 980px) {
    .mobile-auth-entry { display: flex; }
    .auth-user, .desktop-auth-logout { display: none; }
}

@media (max-width: 700px) {
    .auth-modal { width: min(480px, calc(100vw - 28px)); height: min(92dvh, 760px); overflow: auto; }
    .auth-modal-shell { display: flex; min-height: 100%; flex-direction: column; }
    .auth-visual { height: 180px; flex: 0 0 180px; }
    .auth-visual img { object-position: center 34%; }
    .auth-panel { height: auto; min-height: 440px; overflow: visible; padding: 27px 24px 28px; }
    .auth-close { top: 8px; right: 8px; }
    .auth-state h2 { font-size: 25px; }
    .auth-form { margin-top: 21px; }
    .auth-form label { font-size: 13px; }
    .auth-form > input, .auth-password-field input { height: 46px; font-size: 13px; }
    .auth-password-toggle { height: 46px; }
    .auth-submit { height: 46px; }
    .auth-switch-copy { margin-top: 22px; font-size: 12px; }
}
