/* ── Kill browser autofill blue background ── */
.field-wrap input:-webkit-autofill,
.field-wrap input:-webkit-autofill:hover,
.field-wrap input:-webkit-autofill:focus,
.field-wrap input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 999px #fff inset !important;
    box-shadow: 0 0 0 999px #fff inset !important;
    -webkit-text-fill-color: #1a1a1a !important;
    border-color: #e6c4b5 !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* ── Required asterisk ── */
.req-star {
    color: #7A0C06;
    font-size: 0.75rem;
    margin-left: 2px;
}

/* ── Invalid field border ── */
.field-wrap input.field-invalid {
    border-color: #8B0F08 !important;
    box-shadow: 0 0 0 2px rgba(177, 9, 9, 0.12) !important;
}

/* ── Hide per-field text errors (banner only) ── */
.field-error-msg {
    display: none;
}

/* ── Remove card border/background from reg steps ── */
.reg-steps .step {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* ── Role selector spacing ── */
.auth-role-block {
    margin-bottom: 18px;
}

.auth-role-block .role-options {
    margin-top: 0.35rem;
}

.reg-steps .step > [data-reg-next] {
    margin-top: 0.7rem;
}

/* ── Error banner ── */
.auth-form-error {
    display: flex;
    align-items: center;
    gap: 9px;
    border-left: 3px solid #8B0F08;
    background: rgba(139, 15, 8, 0.05);
    border-radius: 0 7px 7px 0;
    padding: 9px 12px;
    margin-bottom: 12px;
    margin-top: 12px;
    animation: authErrFadeIn 0.3s ease-out;
}

.auth-form-error i {
    color: #8B0F08;
    font-size: 15px;
    flex-shrink: 0;
}

.auth-form-error span {
    color: #8B0F08;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

@keyframes authErrFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Toast container ── */
#qb-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

/* ── Toast ── */
.qb-toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid rgba(139, 15, 8, 0.18);
    border-left: 3px solid #8B0F08;
    border-radius: 10px;
    padding: 13px 14px 16px 14px;
    min-width: 290px;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(139, 15, 8, 0.10), 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    animation: qb-slide-in 0.28s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
    font-family: 'DM Sans', sans-serif;
}

.qb-toast.success {
    border-left-color: #16a34a;
    border-color: rgba(22, 163, 74, 0.18);
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.08), 0 1px 4px rgba(0,0,0,0.05);
}

.qb-toast.dismissing {
    animation: qb-slide-out 0.22s ease-in forwards;
}

.qb-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(139, 15, 8, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: qb-icon-pop 0.35s 0.1s cubic-bezier(0.34, 1.6, 0.64, 1) both;
}

.qb-toast.success .qb-toast-icon {
    background: rgba(22, 163, 74, 0.10);
}

.qb-toast-icon svg {
    width: 16px;
    height: 16px;
}

.qb-toast-body {
    flex: 1;
    min-width: 0;
}

.qb-toast-title {
    font-size: 13px;
    font-weight: 600;
    color: #8B0F08;
    margin: 0 0 2px;
    line-height: 1.3;
}

.qb-toast.success .qb-toast-title {
    color: #16a34a;
}

.qb-toast-msg {
    font-size: 13px;
    color: #6b5c52;
    margin: 0;
    line-height: 1.45;
}

.qb-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: #999;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.qb-toast-close:hover {
    background: rgba(139, 15, 8, 0.08);
    color: #8B0F08;
}

.qb-toast.success .qb-toast-close:hover {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
}

.qb-toast-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 10px 10px;
    background: #8B0F08;
    width: 100%;
    transform-origin: left;
    animation: qb-drain 5s linear forwards;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.qb-toast.success .qb-toast-progress {
    background: #16a34a;
}

/* ── Password strength wrapper ── */
.pw-strength {
    margin: 6px 0 10px;
}

/* ── 4-segment bar ── */
.strength-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.strength-bar .seg {
    flex: 1;
    height: 6px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.08);
    transition: background 0.28s ease;
}

/* Segment colours per score */
.strength-bar.strength-1 .seg:nth-child(1)    { background: #d64545; }
.strength-bar.strength-2 .seg:nth-child(-n+2) { background: #f0a500; }
.strength-bar.strength-3 .seg:nth-child(-n+3) { background: #57b846; }
.strength-bar.strength-4 .seg                 { background: #16a34a; }

/* ── Strength label ── */
.strength-label {
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    min-height: 16px;
    margin: 0 0 5px;
    transition: color 0.2s ease;
}

/* ── Criteria checklist ── */
.pw-criteria {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 10px;
}

.pw-criteria li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #9a7b70;
    font-family: 'DM Sans', sans-serif;
    transition: color 0.18s ease;
}

.pw-criteria li::before {
    content: '○';
    color: #c9b3aa;
    font-size: 11px;
    transition: color 0.18s ease;
    flex-shrink: 0;
}

.pw-criteria li.met {
    color: #2a7a2a;
}

.pw-criteria li.met::before {
    content: '✔';
    color: #2a7a2a;
}

/* ── Confirm mismatch ── */
.field-wrap input.mismatch {
    border-color: #8B0F08 !important;
    box-shadow: 0 0 0 2px rgba(177, 9, 9, 0.12) !important;
}

/* ── Close button repositioned to top-right of the right panel ── */
.auth-close {
    position: absolute;
    right: 16px;
    top: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ── Keyframes ── */
@keyframes qb-drain {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@keyframes qb-slide-in {
    from { transform: translateX(calc(100% + 24px)); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes qb-slide-out {
    from { transform: translateX(0); opacity: 1; max-height: 120px; }
    to   { transform: translateX(calc(100% + 24px)); opacity: 0; max-height: 0; }
}

@keyframes qb-icon-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}