/* =====================================================================
   Sign-in, create account and forgot password: one panel on the back
   office design (backoffice.css is loaded first).
   ===================================================================== */

/* Only what this page adds to the back office design */
*, *::before, *::after { box-sizing: border-box; }

body.bo.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px calc(32px + env(safe-area-inset-bottom, 0px));
}

.auth-panel {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(23, 36, 59, .06);
}

.auth-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 28px 20px;
    border-bottom: 1px solid var(--rule-soft);
}

body.bo .auth-head a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

body.bo.auth a { text-decoration: none; }
body.bo.auth a:hover { text-decoration: underline; }

.auth-head .side-brand-mark {
    width: 36px;
    height: 36px;
    font-size: 19px;
}

.auth-head strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
}

.auth-head small {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
}

.auth-body {
    padding: 24px 28px 26px;
}

.auth-title {
    margin: 0 0 4px;
    color: var(--ink);
    font-family: var(--font-title);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.auth-lead {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 14px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-label-row a {
    font-size: 13px;
    font-weight: 500;
}

body.bo .form-control {
    display: block;
    width: 100%;
    height: 44px;
    font-size: 15px;
}

.auth-password {
    position: relative;
}

.auth-password .form-control {
    padding-right: 46px;
}

.auth-reveal {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-reveal:hover { color: var(--ink); }

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--bad);
    font-size: 12.5px;
}

.field-error:empty { display: none; }

.auth-note {
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid var(--bad-line);
    border-left: 3px solid var(--bad);
    background: var(--bad-tint);
    color: var(--bad-ink);
    font-size: 14px;
}

.auth-note.is-ok {
    border-color: var(--ok-line);
    border-left-color: var(--ok);
    background: var(--ok-tint);
    color: var(--ok-ink);
}

body.bo .auth-note ul { margin: 0; padding: 0; list-style: none; }
.validation-summary-valid.auth-note { display: none; }

body.bo .auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 22px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}

.auth-remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
}

body.bo .btn.btn-submit {
    width: 100%;
    min-height: 46px;
    font-size: 15.5px;
    font-weight: 600;
}

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 28px;
    background: var(--panel-sunk);
    border-top: 1px solid var(--rule-soft);
    color: var(--muted);
    font-size: 14px;
}

.auth-foot a {
    font-weight: 600;
}

body.bo .auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted) !important;
    font-size: 14px;
    text-decoration: none;
}

.auth-back:hover { color: var(--ink) !important; }

@media (max-width: 440px) {
    body.bo.auth { justify-content: flex-start; padding-top: 20px; }
    .auth-head, .auth-body { padding-left: 20px; padding-right: 20px; }
    .auth-foot { padding-left: 20px; padding-right: 20px; flex-wrap: wrap; }
    body.bo .form-control { font-size: 16px; }
}

/* Wider panel for forms with two fields side by side (create account) */
.auth-panel.is-wide {
    max-width: 560px;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

body.bo textarea.form-control {
    height: auto;
    min-height: 72px;
    resize: vertical;
}

.auth-optional {
    color: var(--faint);
    font-weight: 400;
}

.auth-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12.5px;
}

/* Numbered steps (forgot password) */
.auth-steps {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.auth-steps li {
    position: relative;
    padding: 0 0 12px 38px;
    counter-increment: step;
    color: var(--text);
    font-size: 14.5px;
}

.auth-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -1px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    background: var(--primary-tint);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.auth-call {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--rule);
    background: var(--panel-sunk);
}

.auth-call i {
    color: var(--primary);
}

.auth-call a {
    color: var(--ink);
    font-family: var(--font-code);
    font-size: 16px;
    font-weight: 500;
}

.auth-small {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

body.bo.auth .btn.btn-submit + .btn,
body.bo.auth .btn-block-auth {
    width: 100%;
}

@media (max-width: 560px) {
    .auth-row { grid-template-columns: 1fr; }
}

/* Buttons that are links keep their look on hover */
body.bo.auth a.btn:hover { text-decoration: none; }

/* Match the admin workspace while keeping authentication layouts independent. */
body.bo.auth {
    --canvas: #F4F6FA;
    --rule: #DFE5EE;
    --rule-soft: #EBEFF5;
    --ink: #17243B;
    --text: #334155;
    --muted: #64748B;
    --primary: #335CDE;
    --primary-hover: #2748B5;
    --primary-tint: #EDF2FF;
    --primary-ring: rgba(51, 92, 222, .18);
    --font-title: var(--font);
}
body.bo.auth .auth-head .side-brand-mark {
    border-radius: 9px;
    background: var(--primary);
    box-shadow: none;
    font-family: var(--font);
}
body.bo.auth .auth-title { font-family: var(--font); letter-spacing: -.025em; }
body.bo.auth .form-control {
    border-radius: 8px;
    border-color: var(--rule);
    background: var(--panel);
}
body.bo.auth .form-control:focus { border-color: var(--primary); }
body.bo.auth .btn { border-radius: 8px; }
body.bo.auth .btn-submit { box-shadow: 0 2px 4px rgba(51, 92, 222, .15); }
body.bo.auth .auth-reveal { border-radius: 7px; }
body.bo.auth .auth-reveal:hover { background: var(--primary-tint); color: var(--primary); }
body.bo.auth .auth-foot { border-radius: 0 0 12px 12px; }
body.bo.auth .auth-note, body.bo.auth .auth-call { border-radius: 8px; }
body.bo.auth .auth-steps li::before { border-radius: 6px; }
