/*
 * MR TRADY Authentication + Onboarding UI
 * Version 4.0.0
 * Scope: Register, Sign In, Verify Email, Forgot/Reset Password, Onboarding.
 */

html:has(body.mr-auth-body) {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.mr-auth-body {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--mr-bg, #f7f9fc);
    color: var(--mr-secondary, #0a0833);
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.mr-auth-body *,
body.mr-auth-body *::before,
body.mr-auth-body *::after {
    box-sizing: border-box;
}

body.mr-auth-body a {
    color: inherit;
}

body.mr-auth-body button,
body.mr-auth-body input,
body.mr-auth-body select {
    font: inherit;
}

body.mr-auth-body #wpadminbar {
    display: none !important;
}

.mr-honeypot {
    position: fixed !important;
    left: -10000px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Logo */
.mr-auth-logo {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    text-decoration: none;
}

.mr-auth-logo-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 78px;
    max-height: 64px;
    object-fit: contain;
}

/* Shared split shell */
.mr-auth-layout {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(420px, 45%) minmax(0, 55%);
    overflow: hidden;
}

.mr-auth-brand-panel {
    position: relative;
    min-width: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 3vw, 44px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 0 0, rgba(244, 197, 66, .12), transparent 32%),
        linear-gradient(145deg, var(--mr-sidebar-start, #0c1121), #0b1230 58%, #080e3d 100%);
}

.mr-auth-brand-panel::before,
.mr-auth-brand-panel::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 50%;
    pointer-events: none;
}

.mr-auth-brand-panel::before {
    width: 540px;
    height: 540px;
    right: -210px;
    top: -270px;
}

.mr-auth-brand-panel::after {
    width: 350px;
    height: 350px;
    left: -190px;
    bottom: -180px;
}

.mr-auth-brand-top,
.mr-auth-brand-content,
.mr-auth-brand-footer {
    position: relative;
    z-index: 2;
}

.mr-auth-brand-content {
    width: min(640px, 100%);
    margin: auto 0;
    padding: 26px 0;
}

.mr-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border: 1px solid rgba(244, 197, 66, .36);
    border-radius: 999px;
    background: rgba(244, 197, 66, .055);
    color: #f9cf57;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.mr-auth-badge span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mr-primary, #f4c542);
    box-shadow: 0 0 0 6px rgba(244, 197, 66, .08);
}

.mr-auth-brand-content h2 {
    max-width: 620px;
    margin: 30px 0 20px;
    color: #fff;
    font-size: clamp(46px, 5.2vw, 76px);
    line-height: .99;
    letter-spacing: -.055em;
    font-weight: 800;
}

.mr-auth-brand-content h2 strong {
    display: block;
    color: var(--mr-primary, #f4c542);
    font-weight: 800;
}

.mr-auth-brand-content > p {
    max-width: 620px;
    margin: 0;
    color: #b9c1d0;
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.65;
}

.mr-auth-benefits {
    list-style: none;
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 32px 0 0;
}

.mr-auth-benefits li {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #f4f6fb;
    font-size: 13px;
    line-height: 1.45;
}

.mr-auth-benefits li > span {
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--mr-primary, #f4c542);
    color: var(--mr-secondary, #0a0833);
    font-size: 16px;
    font-weight: 800;
}

.mr-auth-brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #959eb2;
    font-size: 12px;
}

.mr-auth-brand-footer a {
    color: #dfe3ee;
    text-decoration: none;
}

.mr-auth-stage {
    position: relative;
    min-width: 0;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3.2vw, 48px);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0, rgba(244, 197, 66, .18), transparent 25%),
        linear-gradient(135deg, #fbfcff 0%, #f5f7fb 67%, #edf2f7 100%);
}

.mr-auth-card {
    position: relative;
    width: min(660px, 100%);
    max-height: calc(100dvh - 28px);
    padding: clamp(28px, 3.2vw, 48px);
    overflow: hidden;
    border: 1px solid rgba(10, 8, 51, .07);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 26px 76px rgba(22, 34, 60, .13);
}

.mr-auth-card-login,
.mr-auth-card-compact {
    max-width: 620px;
}

.mr-auth-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    margin-bottom: 8px;
}

.mr-auth-mobilebar {
    display: none;
}

.mr-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #171a27;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.mr-auth-back:hover,
.mr-auth-back:focus-visible {
    color: #6d5b00;
}

.mr-auth-heading h1 {
    margin: 0;
    color: #0b1020;
    font-size: clamp(30px, 2.5vw, 40px);
    line-height: 1.08;
    letter-spacing: -.045em;
    font-weight: 800;
}

.mr-auth-heading p {
    margin: 6px 0 0;
    color: #737e8f;
    font-size: 13px;
    line-height: 1.55;
}

.mr-auth-heading-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #fff5cf;
    color: #675500;
    font-size: 20px;
    font-weight: 800;
}

.mr-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 16px 0 22px;
    padding: 5px;
    border: 1px solid var(--mr-border, #e7ecf3);
    border-radius: 14px;
    background: #f3f6fb;
}

.mr-auth-tabs a,
.mr-auth-tabs span {
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 8px 13px;
    border-radius: 10px;
    color: #747f91;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.mr-auth-tabs .is-active {
    color: #181a20;
    background: var(--mr-primary, #f4c542);
    box-shadow: 0 10px 24px rgba(244, 197, 66, .25);
}

/* Alerts stay out of document flow so no page grows after validation. */
.mr-auth-alert:not(.d-none) {
    position: fixed;
    z-index: 9999;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    width: min(540px, calc(100vw - 24px));
    transform: translateX(-50%);
    padding: 11px 14px;
    border: 1px solid #efb9c0;
    border-radius: 12px;
    background: #fff1f3;
    color: #8f2735;
    box-shadow: 0 14px 38px rgba(20, 31, 52, .16);
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
}

.mr-auth-alert.is-success {
    border-color: #b9e7cd;
    background: #effbf4;
    color: #176638;
}

.mr-auth-alert.is-warning {
    border-color: #f0d881;
    background: #fff9df;
    color: #6d5a00;
}

/* Forms */
.mr-auth-form label,
.mr-onboarding-form label {
    display: block;
    margin: 0 0 5px;
    color: #303849;
    font-size: 12px;
    font-weight: 700;
}

.mr-auth-form label span,
.mr-onboarding-form label span {
    color: #8e98a8;
    font-weight: 500;
}

.mr-auth-form .form-control,
.mr-onboarding-form .form-control,
.mr-onboarding-form .form-select {
    min-height: 46px;
    border: 1px solid #d7dee8;
    border-radius: 11px;
    padding: 10px 13px;
    background: #fbfcfe;
    color: #15192a;
    font-size: 14px;
    line-height: 1.35;
    box-shadow: none;
}

.mr-auth-form .form-select,
.mr-onboarding-form .form-select {
    padding-right: 38px;
}

.mr-auth-form .form-control::placeholder,
.mr-onboarding-form .form-control::placeholder {
    color: #a5afbd;
}

.mr-auth-form .form-control:focus,
.mr-onboarding-form .form-control:focus,
.mr-onboarding-form .form-select:focus {
    border-color: var(--mr-primary, #f4c542);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(244, 197, 66, .14);
}

.mr-auth-form .form-control.is-invalid,
.mr-onboarding-form .form-control.is-invalid,
.mr-onboarding-form .form-select.is-invalid,
.form-check-input.is-invalid {
    border-color: #d85f70;
    background-image: none;
}

.invalid-feedback {
    display: block;
    min-height: 0;
    margin-top: 3px;
    color: #b23b4a;
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 600;
}

.invalid-feedback:empty {
    display: none;
}

.mr-auth-input-icon-wrap {
    position: relative;
}

.mr-auth-input-icon-wrap .form-control {
    padding-right: 44px;
}

.mr-auth-input-leading .form-control {
    padding-left: 42px;
}

.mr-auth-leading-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #8f9aaa;
    font-size: 14px;
    pointer-events: none;
}

.mr-auth-eye {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 7px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8994a4;
    cursor: pointer;
}

.mr-auth-eye:hover,
.mr-auth-eye:focus-visible,
.mr-auth-eye.is-visible {
    outline: 0;
    background: #eef2f7;
    color: var(--mr-secondary, #0a0833);
}

.mr-auth-field + .mr-auth-field {
    margin-top: 18px;
}

.mr-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mr-auth-label-row a {
    margin-bottom: 5px;
    color: #675800;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.mr-auth-check {
    min-height: 19px;
    padding-left: 24px;
}

.mr-auth-check .form-check-input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    margin-left: -24px;
    border-color: #99a4b3;
    border-radius: 4px;
    box-shadow: none;
}

.mr-auth-check .form-check-input:checked {
    border-color: var(--mr-primary-deep, #e7b61f);
    background-color: var(--mr-primary, #f4c542);
}

.mr-auth-check .form-check-label {
    margin: 0;
    color: #667083;
    font-size: 11.5px;
    line-height: 1.45;
    font-weight: 500;
}

.mr-auth-check .form-check-label a {
    color: #5f5100;
    font-weight: 700;
}

.mr-auth-remember {
    margin: 12px 0 14px;
}

.mr-auth-primary {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--mr-primary-deep, #e7b61f);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffd85a 0%, #f4c542 62%, #f1bc14 100%);
    color: #171820;
    box-shadow: 0 13px 28px rgba(244, 197, 66, .2);
    font-size: 14px;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.mr-auth-primary:hover,
.mr-auth-primary:focus-visible {
    border-color: var(--mr-primary-deep, #e7b61f);
    color: #171820;
    box-shadow: 0 15px 32px rgba(244, 197, 66, .28);
    transform: translateY(-1px);
}

.mr-auth-primary:disabled {
    transform: none;
    opacity: .72;
    cursor: wait;
}

.mr-auth-arrow {
    font-size: 15px;
}

.mr-auth-submit-spaced {
    margin-top: 20px;
}

.mr-auth-switch {
    margin: 11px 0 0;
    text-align: center;
    color: #818b9b;
    font-size: 11px;
}

.mr-auth-switch a {
    color: #5f5200;
    text-decoration: none;
    font-weight: 800;
}

.mr-auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 9px 0 0;
    color: #96a0ae;
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
}

.mr-register-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 11px 13px;
}

.mr-span-2 {
    grid-column: 1 / -1;
}

.mr-password-strength {
    margin-top: -3px;
}

.mr-password-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.mr-password-bars span {
    height: 3px;
    border-radius: 999px;
    background: #e4e9f0;
}

.mr-password-strength[data-score="1"] .mr-password-bars span:nth-child(-n+1) { background: #e56b78; }
.mr-password-strength[data-score="2"] .mr-password-bars span:nth-child(-n+2) { background: #e5a930; }
.mr-password-strength[data-score="3"] .mr-password-bars span:nth-child(-n+3) { background: #80b95f; }
.mr-password-strength[data-score="4"] .mr-password-bars span { background: #43a96e; }

.mr-password-strength small {
    display: block;
    margin-top: 4px;
    color: #8792a2;
    font-size: 10px;
    line-height: 1.3;
}

/* Verification and reset pages */
.mr-compact-page {
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0, rgba(244, 197, 66, .14), transparent 24%),
        #f4f6f9;
}

.mr-compact-card {
    width: min(620px, 100%);
    max-height: calc(100dvh - 32px);
    padding: clamp(34px, 5vw, 56px);
    overflow: hidden;
    border: 1px solid #e5eaf0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 50px rgba(20, 31, 52, .09);
}

.mr-compact-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.mr-compact-logo .mr-auth-logo-image {
    max-width: 82px;
    max-height: 72px;
}

.mr-compact-heading {
    text-align: center;
}

.mr-compact-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 0 auto 13px;
    border-radius: 12px;
    background: #fff5cf;
    color: #675500;
    font-size: 19px;
    font-weight: 800;
}

.mr-compact-icon.is-warning {
    background: #fff1f3;
    color: #b23b4a;
}

.mr-compact-heading h1 {
    margin: 0;
    color: #0b1020;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -.035em;
    font-weight: 800;
}

.mr-compact-heading p {
    max-width: 480px;
    margin: 9px auto 0;
    color: #707b8b;
    font-size: 13px;
    line-height: 1.6;
}

.mr-verify-form,
.mr-reset-card .mr-auth-form {
    margin-top: 24px;
}

.mr-code-label {
    display: block;
    margin: 0 0 6px;
    color: #303849;
    font-size: 12px;
    font-weight: 700;
}

.mr-code-input {
    width: 100%;
    height: 58px;
    border: 1px solid #cfd7e2;
    border-radius: 12px;
    padding: 8px 18px;
    background: #fff;
    color: #111525;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: .28em;
}

.mr-code-input:focus {
    outline: 0;
    border-color: var(--mr-primary, #f4c542);
    box-shadow: 0 0 0 3px rgba(244, 197, 66, .14);
}

.mr-verify-form .mr-auth-primary {
    margin-top: 14px;
}

.mr-verify-actions {
    display: grid;
    justify-items: center;
    gap: 9px;
    margin-top: 18px;
}

.mr-verify-actions a,
.mr-link-button {
    border: 0;
    background: none;
    color: #1268c7;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.mr-compact-note {
    margin: 16px 0 0;
    color: #99a2af;
    text-align: center;
    font-size: 11px;
}

.mr-reset-confirm-field {
    margin-top: 13px !important;
}

/* Onboarding */
.mr-onboarding-page {
    width: 100%;
    height: 100dvh;
    display: grid;
    grid-template-columns: minmax(440px, 48%) minmax(0, 52%);
    overflow: hidden;
    background: #f4f7fb;
}

.mr-onboarding-form-side {
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 2.7vw, 42px);
    overflow: hidden;
    background: #fff;
}

.mr-onboarding-shell {
    width: min(570px, 100%);
    max-height: calc(100dvh - 28px);
    display: flex;
    flex-direction: column;
    padding: clamp(18px, 2vw, 30px);
    overflow: hidden;
    border: 1px solid #e8edf3;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(32, 45, 70, .07);
}

.mr-onboarding-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.mr-onboarding-brand-row .mr-auth-logo-image {
    max-width: 70px;
    max-height: 54px;
}

.mr-onboarding-signout {
    color: #687385;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.mr-onboarding-progress-head {
    flex: 0 0 auto;
}

.mr-onboarding-step-label {
    display: block;
    margin-bottom: 7px;
    color: #566173;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.mr-onboarding-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf3;
}

.mr-onboarding-progress-bar {
    width: 25%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffd85a, var(--mr-primary, #f4c542));
    transition: width .25s ease;
}

.mr-onboarding-copy {
    flex: 0 0 auto;
    margin: 18px 0 16px;
}

.mr-onboarding-copy h1 {
    margin: 0;
    color: #0c1121;
    font-size: clamp(25px, 2.15vw, 32px);
    line-height: 1.12;
    letter-spacing: -.04em;
    font-weight: 800;
}

.mr-onboarding-copy p {
    margin: 5px 0 0;
    color: #778293;
    font-size: 12.5px;
    line-height: 1.5;
}

.mr-onboarding-alert-wrap {
    flex: 0 0 auto;
}

.mr-onboarding-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mr-onboarding-step {
    flex: 1 1 auto;
    min-height: 0;
}

.mr-onboarding-step[hidden] {
    display: none !important;
}

.mr-onboarding-section-title {
    margin: 0 0 12px;
    color: #151a2c;
    font-size: 16px;
    font-weight: 700;
}

.mr-onboarding-section-subtitle {
    margin: -6px 0 13px;
    color: #818b9a;
    font-size: 11.5px;
}

.mr-onboarding-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 13px;
}

.mr-choice-stack {
    display: grid;
    gap: 8px;
}

.mr-choice-card {
    position: relative;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #dce2ea;
    border-radius: 11px;
    background: #fff;
    color: #202638;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.mr-choice-card:hover {
    border-color: #c6cfda;
}

.mr-choice-card:has(input:checked) {
    border-color: #efd052;
    background: #fffdf5;
    box-shadow: 0 0 0 2px rgba(244, 197, 66, .08);
}

.mr-choice-card input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--mr-primary-deep, #e7b61f);
}

.mr-choice-card span {
    font-size: 12.5px;
    font-weight: 500;
}

.mr-onboarding-upload {
    position: relative;
    padding: 11px;
    border: 1px dashed #ccd5e0;
    border-radius: 12px;
    background: #fbfcfe;
}

.mr-onboarding-upload small {
    display: block;
    margin: 0 0 7px;
    color: #7a8595;
    font-size: 10.5px;
}

.mr-onboarding-upload input[type="file"] {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d7dee8;
    border-radius: 9px;
    background: #fff;
    color: #586274;
    font-size: 11px;
}

.mr-onboarding-upload input[type="file"]::file-selector-button {
    min-height: 36px;
    margin: 0 9px 0 0;
    border: 0;
    border-right: 1px solid #e0e5eb;
    padding: 0 12px;
    background: #f0f3f7;
    color: #2d3545;
    font-weight: 600;
}

.mr-onboarding-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.mr-onboarding-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mr-onboarding-secondary,
.mr-onboarding-skip {
    min-height: 42px;
    border: 0;
    background: transparent;
    color: #667183;
    font-size: 12px;
    font-weight: 600;
}

.mr-onboarding-actions .mr-auth-primary {
    min-width: 104px;
    min-height: 43px;
    padding-inline: 18px;
    font-size: 12.5px;
}

.mr-onboarding-preview-side {
    position: relative;
    height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(44px, 7vh, 82px) clamp(24px, 4vw, 60px);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0, rgba(244, 197, 66, .13), transparent 24%),
        linear-gradient(135deg, #f5f8fb 0%, #eaf0f6 100%);
}

.mr-invoice-preview-wrap {
    width: min(490px, 100%);
}

.mr-invoice-preview-card {
    position: relative;
    padding: 22px;
    border: 1px solid #e5eaf0;
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 50px rgba(31, 44, 68, .11);
}

.mr-invoice-preview-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1a2133;
    font-size: 14px;
    font-weight: 700;
}

.mr-invoice-preview-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff4c7;
    color: #8a6d00;
    font-size: 16px;
}

.mr-invoice-preview-logo {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 12px;
    background: #fff5c7;
    box-shadow: 0 10px 24px rgba(244, 197, 66, .2);
}

.mr-invoice-preview-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mr-invoice-preview-copy {
    margin: 12px 0 14px;
    color: #7a8594;
    font-size: 11px;
}

.mr-invoice-paper {
    padding: 16px;
    border: 1px solid #e2e7ee;
    border-radius: 14px;
    background: #fcfdff;
}

.mr-invoice-paper-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.mr-invoice-business-name {
    display: block;
    color: #12182a;
    font-size: 14px;
    font-weight: 700;
}

.mr-invoice-address,
.mr-invoice-meta,
.mr-invoice-contact,
.mr-invoice-summary {
    color: #5f6a7c;
    font-size: 10.5px;
    line-height: 1.55;
}

.mr-invoice-meta {
    text-align: right;
}

.mr-invoice-rule {
    height: 1px;
    margin: 13px 0;
    background: #2d3544;
}

.mr-invoice-summary {
    margin-top: 10px;
}

.mr-invoice-tip {
    margin: 14px 0 0;
    color: #7c8796;
    font-size: 11px;
}

/* Fatal onboarding state */
.mr-onboarding-fatal {
    display: grid;
    justify-items: start;
    gap: 10px;
}

.mr-onboarding-fatal > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff1f3;
    color: #b23b4a;
    font-weight: 800;
}

.mr-onboarding-fatal h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

.mr-onboarding-fatal p {
    margin: 0 0 8px;
    color: #707b8b;
    font-size: 13px;
}

/* Desktop height tuning without making text tiny. */
@media (min-width: 992px) and (max-height: 790px) {
    .mr-auth-brand-panel {
        padding: 22px 30px;
    }

    .mr-auth-brand-content {
        padding: 12px 0;
    }

    .mr-auth-brand-content h2 {
        margin: 20px 0 14px;
        font-size: clamp(40px, 4.8vw, 64px);
    }

    .mr-auth-benefits {
        gap: 9px;
        margin-top: 20px;
    }

    .mr-auth-card {
        padding: 24px 32px;
    }

    .mr-auth-heading h1 {
        font-size: 30px;
    }

    .mr-auth-tabs {
        margin: 12px 0 15px;
    }

    .mr-register-grid {
        gap-block: 8px;
    }

    .mr-auth-form .form-control {
        min-height: 42px;
    }

    .mr-onboarding-shell {
        padding: 18px 24px;
    }

    .mr-onboarding-copy {
        margin: 12px 0;
    }

    .mr-onboarding-grid,
    .mr-choice-stack {
        gap: 8px;
    }

    .mr-choice-card {
        min-height: 41px;
        padding-block: 7px;
    }

    .mr-onboarding-actions {
        margin-top: 11px;
    }
}

/* Mobile and tablet. No document scrolling by design. */
@media (max-width: 991.98px) {
    body.mr-auth-body {
        font-size: 14px;
    }

    .mr-auth-layout {
        display: block;
        height: 100dvh;
    }

    .mr-auth-brand-panel {
        display: none;
    }

    .mr-auth-stage {
        width: 100%;
        height: 100dvh;
        padding: 0;
        align-items: stretch;
    }

    .mr-auth-card {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: max(14px, env(safe-area-inset-top)) 22px max(14px, env(safe-area-inset-bottom));
        overflow: hidden;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mr-auth-mobilebar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 12px;
    }

    .mr-auth-mobilebar .mr-auth-logo-image {
        max-width: 55px;
        max-height: 46px;
    }

    .mr-auth-card-topline {
        display: none;
    }

    .mr-auth-back {
        font-size: 12px;
    }

    .mr-auth-heading {
        flex: 0 0 auto;
    }

    .mr-auth-heading h1 {
        font-size: clamp(26px, 7vw, 32px);
    }

    .mr-auth-heading p {
        margin-top: 4px;
        font-size: 12px;
    }

    .mr-auth-tabs {
        flex: 0 0 auto;
        margin: 10px 0 13px;
    }

    .mr-auth-tabs a,
    .mr-auth-tabs span {
        min-height: 42px;
        font-size: 14px;
    }

    .mr-auth-form label,
    .mr-onboarding-form label {
        margin-bottom: 4px;
        font-size: 11.5px;
    }

    .mr-auth-form .form-control,
    .mr-onboarding-form .form-control,
    .mr-onboarding-form .form-select {
        min-height: 43px;
        padding: 8px 11px;
        border-radius: 10px;
        font-size: 16px;
    }

    .mr-register-grid {
        gap: 8px 10px;
    }

    .mr-register-form {
        flex: 0 0 auto;
    }

    .invalid-feedback {
        font-size: 10px;
    }

    .mr-register-body .invalid-feedback {
        display: none;
    }

    .mr-password-strength {
        margin-top: -1px;
    }

    .mr-password-strength small {
        margin-top: 3px;
        font-size: 9.5px;
    }

    .mr-auth-check {
        padding-left: 22px;
    }

    .mr-auth-check .form-check-input {
        width: 16px;
        height: 16px;
        margin-left: -22px;
    }

    .mr-auth-check .form-check-label {
        font-size: 10.5px;
    }

    .mr-auth-primary {
        min-height: 45px;
        font-size: 13.5px;
    }

    .mr-auth-switch {
        margin-top: 8px;
        font-size: 10.5px;
    }

    .mr-auth-security {
        margin-top: 6px;
        font-size: 9.5px;
    }

    .mr-auth-field + .mr-auth-field {
        margin-top: 14px;
    }

    .mr-auth-label-row a {
        font-size: 11.5px;
    }

    .mr-auth-remember {
        margin: 10px 0 12px;
    }

    .mr-auth-submit-spaced {
        margin-top: 16px;
    }

    /* Verification/reset compact mobile */
    .mr-compact-page {
        height: 100dvh;
        padding: 0;
        align-items: stretch;
    }

    .mr-compact-card {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: max(20px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
        overflow: hidden;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mr-compact-logo {
        margin-bottom: 16px;
    }

    .mr-compact-logo .mr-auth-logo-image {
        max-width: 70px;
        max-height: 60px;
    }

    .mr-compact-heading h1 {
        font-size: 25px;
    }

    .mr-compact-heading p {
        margin-top: 7px;
        font-size: 12px;
    }

    .mr-code-input {
        height: 54px;
        font-size: 21px;
    }

    .mr-verify-actions a,
    .mr-link-button {
        font-size: 12.5px;
    }

    .mr-compact-note {
        font-size: 10.5px;
    }

    /* Onboarding mobile - one step per viewport, no page scroll. */
    .mr-onboarding-page {
        display: block;
        height: 100dvh;
    }

    .mr-onboarding-preview-side {
        display: none;
    }

    .mr-onboarding-form-side {
        height: 100dvh;
        padding: 0;
        align-items: stretch;
    }

    .mr-onboarding-shell {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        justify-content: center;
        padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
        overflow: hidden;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mr-onboarding-brand-row {
        margin-bottom: 10px;
    }

    .mr-onboarding-brand-row .mr-auth-logo-image {
        max-width: 58px;
        max-height: 46px;
    }

    .mr-onboarding-signout {
        font-size: 11.5px;
    }

    .mr-onboarding-step-label {
        margin-bottom: 6px;
        font-size: 10.5px;
    }

    .mr-onboarding-progress-track {
        height: 7px;
    }

    .mr-onboarding-copy {
        margin: 14px 0 13px;
    }

    .mr-onboarding-copy h1 {
        font-size: clamp(25px, 7vw, 30px);
    }

    .mr-onboarding-copy p {
        font-size: 12px;
    }

    .mr-onboarding-section-title {
        margin-bottom: 10px;
        font-size: 15px;
    }

    .mr-onboarding-section-subtitle {
        font-size: 11px;
    }

    .mr-onboarding-grid {
        gap: 9px 10px;
    }

    .mr-choice-stack {
        gap: 8px;
    }

    .mr-choice-card {
        min-height: 44px;
        padding: 8px 11px;
    }

    .mr-choice-card span {
        font-size: 12.5px;
    }

    .mr-onboarding-upload {
        padding: 9px;
    }

    .mr-onboarding-actions {
        margin-top: 13px;
    }

    .mr-onboarding-secondary,
    .mr-onboarding-skip {
        min-height: 40px;
        font-size: 11.5px;
    }

    .mr-onboarding-actions .mr-auth-primary {
        min-height: 42px;
        font-size: 12.5px;
    }
}

/* Short mobile screens: compact spacing only; keep readable type. */
@media (max-width: 991.98px) and (max-height: 700px) {
    .mr-auth-card {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .mr-auth-mobilebar {
        margin-bottom: 7px;
    }

    .mr-auth-mobilebar .mr-auth-logo-image {
        max-width: 48px;
        max-height: 40px;
    }

    .mr-auth-heading h1 {
        font-size: 24px;
    }

    .mr-auth-heading p {
        font-size: 11.5px;
    }

    .mr-auth-tabs {
        margin: 7px 0 9px;
    }

    .mr-auth-tabs a,
    .mr-auth-tabs span {
        min-height: 38px;
        font-size: 13px;
    }

    .mr-register-grid {
        gap-block: 6px;
    }

    .mr-auth-form label {
        font-size: 11px;
    }

    .mr-auth-form .form-control {
        min-height: 39px;
        padding-block: 6px;
        font-size: 14px;
    }

    .mr-password-strength small,
    .mr-auth-security {
        display: none;
    }

    .mr-auth-check .form-check-label {
        font-size: 10px;
    }

    .mr-auth-primary {
        min-height: 40px;
    }

    .mr-auth-switch {
        margin-top: 5px;
    }

    .mr-onboarding-shell {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .mr-onboarding-brand-row {
        margin-bottom: 7px;
    }

    .mr-onboarding-brand-row .mr-auth-logo-image {
        max-width: 48px;
        max-height: 40px;
    }

    .mr-onboarding-copy {
        margin: 10px 0;
    }

    .mr-onboarding-copy h1 {
        font-size: 23px;
    }

    .mr-onboarding-copy p,
    .mr-onboarding-section-subtitle {
        display: none;
    }

    .mr-onboarding-grid,
    .mr-choice-stack {
        gap: 7px;
    }

    .mr-onboarding-form .form-control,
    .mr-onboarding-form .form-select {
        min-height: 39px;
        font-size: 14px;
    }

    .mr-choice-card {
        min-height: 39px;
        padding-block: 6px;
    }

    .mr-onboarding-actions {
        margin-top: 9px;
    }
}

@media (max-width: 380px) {
    .mr-auth-card,
    .mr-onboarding-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .mr-register-grid,
    .mr-onboarding-grid {
        gap-inline: 7px;
    }

    .mr-auth-form .form-control,
    .mr-onboarding-form .form-control,
    .mr-onboarding-form .form-select {
        padding-inline: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mr-auth-body *,
    body.mr-auth-body *::before,
    body.mr-auth-body *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
