/* =========================================================
   CATEREASE CUSTOMER AUTH V21
   Clean single-card authentication layout
   Existing authentication IDs and JS behavior are preserved.
========================================================= */

:root {
    --auth-navy-900: #071642;
    --auth-navy-800: #0a1b50;
    --auth-navy-700: #132d6a;
    --auth-red: #d72638;

    --auth-page: #f4f7fc;
    --auth-white: #ffffff;
    --auth-soft: #f8fafd;
    --auth-icon-bg: #f2f6fb;

    --auth-text: #101a3a;
    --auth-muted: #6d7890;
    --auth-border: #dbe3ee;
    --auth-border-strong: #c8d4e3;

    --auth-success: #16804a;
    --auth-danger: #c32636;
    --auth-info: #1d4ed8;

    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --auth-fast: 220ms var(--auth-ease);
    --auth-shadow: 0 24px 70px rgba(14, 35, 78, 0.11);
}

/* =========================================================
   RESET / PAGE
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--auth-page);
}

body.customer-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;

    display: grid;
    place-items: center;

    padding: 22px;

    color: var(--auth-text);
    font-family: "Poppins", sans-serif;
    background: var(--auth-page);

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

button:not(:disabled) {
    cursor: pointer;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

::selection {
    color: #ffffff;
    background: var(--auth-red);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[role="checkbox"]:focus-visible {
    outline: 3px solid rgba(10, 27, 80, 0.12);
    outline-offset: 3px;
}

/* =========================================================
   AUTH CARD
========================================================= */

.auth-shell {
    --pointer-x: 50%;
    --pointer-y: 50%;

    width: min(640px, calc(100% - 24px));
    height: min(590px, calc(100dvh - 48px));
    min-height: 550px;

    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--auth-border);
    border-radius: 24px;

    background: var(--auth-white);
    box-shadow: var(--auth-shadow);

    transition:
        width 420ms var(--auth-ease),
        height 420ms var(--auth-ease),
        border-color var(--auth-fast),
        box-shadow var(--auth-fast);

    animation: authCardEnter 620ms var(--auth-ease) both;
}

.auth-shell:hover {
    border-color: #cfdae8;
    box-shadow: 0 28px 76px rgba(14, 35, 78, 0.13);
}

.auth-shell.showing-sign-up {
    width: min(760px, calc(100% - 24px));
    height: min(760px, calc(100dvh - 48px));
    min-height: 650px;
}

.shell-top-accent {
    width: 86px;
    height: 4px;

    position: absolute;
    top: 0;
    left: 34px;
    z-index: 5;

    border-radius: 0 0 999px 999px;
    background: var(--auth-red);
}

/* =========================================================
   TOP BAR
========================================================= */

.auth-topbar {
    flex: 0 0 62px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 14px 22px 8px;
}

.back-home {
    text-decoration: none;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--auth-navy-900);
    font-size: 0.74rem;
    font-weight: 700;

    transition: color var(--auth-fast), transform var(--auth-fast);
}

.back-home:hover {
    color: var(--auth-red);
    transform: translateX(-2px);
}

.back-home-icon {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: 1px solid var(--auth-border);
    border-radius: 10px;

    background: var(--auth-soft);

    transition:
        border-color var(--auth-fast),
        background var(--auth-fast),
        transform var(--auth-fast);
}

.back-home:hover .back-home-icon {
    border-color: #c5d1e0;
    background: #ffffff;
    transform: translateX(-1px);
}

/* =========================================================
   SHARED BRAND AREA
========================================================= */

.auth-shared-header {
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 2px 30px 20px;
}

.auth-logo-frame {
    width: 92px;
    height: 92px;

    display: grid;
    place-items: center;

    margin-bottom: 8px;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-logo {
    width: 88px;
    height: 88px;

    display: block;
    object-fit: contain;
}

.auth-business-name {
    margin: 0 0 16px;

    color: var(--auth-navy-900);

    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.35;
    text-align: center;
}

.auth-mode-tabs {
    width: min(350px, 100%);
    height: 42px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;

    padding: 4px;

    border: 1px solid var(--auth-border);
    border-radius: 13px;

    background: var(--auth-soft);
}

.auth-mode-tab {
    min-width: 0;

    position: relative;

    border: 1px solid transparent;
    border-radius: 9px;

    color: var(--auth-muted);
    background: transparent;

    font-size: 0.74rem;
    font-weight: 700;

    transition:
        color var(--auth-fast),
        background var(--auth-fast),
        border-color var(--auth-fast),
        box-shadow var(--auth-fast),
        transform var(--auth-fast);
}

.auth-mode-tab:hover {
    color: var(--auth-navy-900);
}

.auth-mode-tab-signin,
.auth-shell.showing-sign-up .auth-mode-tab-signup {
    color: var(--auth-navy-900);
    border-color: var(--auth-border);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(10, 27, 80, 0.06);
}

.auth-shell.showing-sign-up .auth-mode-tab-signin {
    color: var(--auth-muted);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.auth-mode-tab-signin::after,
.auth-mode-tab-signup::after {
    content: "";

    width: 28px;
    height: 2px;

    position: absolute;
    left: 50%;
    bottom: 4px;

    border-radius: 999px;
    background: var(--auth-red);

    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform var(--auth-fast);
}

.auth-mode-tab-signin::after,
.auth-shell.showing-sign-up .auth-mode-tab-signup::after {
    transform: translateX(-50%) scaleX(1);
}

.auth-shell.showing-sign-up .auth-mode-tab-signin::after {
    transform: translateX(-50%) scaleX(0);
}

.compat-prompt {
    display: none !important;
}

/* =========================================================
   FORM STAGE / PANELS
========================================================= */

.form-stage {
    min-height: 0;
    flex: 1 1 auto;

    position: relative;
    overflow: hidden;
}

.form-panel {
    position: absolute;
    inset: 0;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(10px);

    transition:
        opacity 260ms ease,
        visibility 260ms ease,
        transform 360ms var(--auth-ease);
}

.form-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.auth-form {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 4px clamp(32px, 6vw, 62px) 32px;

    scrollbar-width: thin;
    scrollbar-color: #c3cedd transparent;
}

.registration-form {
    padding-top: 0;
    padding-left: clamp(26px, 5vw, 52px);
    padding-right: clamp(26px, 5vw, 52px);
    padding-bottom: 24px;
}

.login-form {
    padding-top: 8px;
}

.auth-form::-webkit-scrollbar {
    width: 6px;
}

.auth-form::-webkit-scrollbar-track {
    background: transparent;
}

.auth-form::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c3cedd;
}

/* =========================================================
   FORM HEADER
========================================================= */

.form-header {
    width: 100%;

    margin-bottom: 16px;

    text-align: center;
}

.registration-header {
    margin-bottom: 15px;
}

.auth-form h1 {
    color: var(--auth-navy-900);

    font-size: clamp(1.55rem, 2.6vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.form-subtitle {
    margin-top: 5px;

    color: var(--auth-muted);

    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.55;
}

/* =========================================================
   INPUT LAYOUT
========================================================= */

.name-grid,
.password-grid {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

    margin-bottom: 8px;
}

.name-grid .input-group,
.password-grid .input-group {
    margin-bottom: 0;
}

.input-group {
    width: 100%;
    min-height: 58px;

    position: relative;
    overflow: hidden;

    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;

    margin-bottom: 8px;

    border: 1px solid var(--auth-border);
    border-radius: 13px;

    background: #ffffff;

    text-align: left;

    transition:
        border-color var(--auth-fast),
        box-shadow var(--auth-fast),
        transform var(--auth-fast),
        background var(--auth-fast);
}

.input-group:hover {
    border-color: var(--auth-border-strong);
}

.input-group:focus-within {
    border-color: #9fb0c9;
    box-shadow: 0 0 0 3px rgba(10, 27, 80, 0.045);
}

.input-group.is-activated {
    animation: authInputActivate 520ms var(--auth-ease);
}

.input-icon {
    width: 48px;
    height: 100%;

    display: grid;
    place-items: center;

    border-right: 1px solid var(--auth-border);

    color: var(--auth-navy-800);
    background: var(--auth-icon-bg);

    font-size: 0.84rem;

    transition:
        color var(--auth-fast),
        background var(--auth-fast),
        border-color var(--auth-fast);
}

.input-group:focus-within .input-icon {
    color: var(--auth-red);
    background: #fffafb;
    border-right-color: #eed2d7;
}

.input-group input {
    width: 100%;
    height: 100%;
    min-width: 0;

    grid-column: 2;

    padding: 24px 44px 8px 14px;

    border: 0;
    outline: 0;

    color: var(--auth-text);
    background: transparent;

    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.input-group:not(.password-group) input {
    padding-right: 15px;
}

.auth-suffix-field {
    position: relative;
    z-index: 12;
    min-width: 0;
    min-height: 58px;
}

.auth-suffix-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-suffix-trigger {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 38px;
    align-items: center;
    padding: 0 9px 0 0;
    border: 1px solid var(--auth-border);
    border-radius: 13px;
    color: var(--auth-text);
    background: #ffffff;
    text-align: left;
    transition: border-color var(--auth-fast), box-shadow var(--auth-fast);
}

.auth-suffix-trigger:hover,
.auth-suffix-trigger:focus-visible,
.auth-suffix-field.is-open .auth-suffix-trigger {
    border-color: #9fb0c9;
    box-shadow: 0 0 0 3px rgba(10, 27, 80, 0.045);
}

.auth-suffix-icon {
    width: 48px;
    height: 56px;
    display: grid;
    place-items: center;
    border-right: 1px solid var(--auth-border);
    border-radius: 12px 0 0 12px;
    color: var(--auth-navy-800);
    background: var(--auth-icon-bg);
    font-size: 0.84rem;
}

.auth-suffix-field.is-open .auth-suffix-icon {
    color: var(--auth-red);
    background: #fffafb;
    border-right-color: #eed2d7;
}

.auth-suffix-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 7px 12px;
}

.auth-suffix-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-red);
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1;
}

.auth-suffix-label small {
    padding: 3px 6px;
    border-radius: 999px;
    color: #748096;
    background: #eef2f7;
    font-size: 0.52rem;
    font-weight: 700;
}

.auth-suffix-copy strong {
    overflow: hidden;
    color: var(--auth-text);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.auth-suffix-chevron {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--auth-navy-800);
    background: #f1f5fa;
    font-size: 0.67rem;
    transition: color var(--auth-fast), background var(--auth-fast), transform var(--auth-fast);
}

.auth-suffix-field.is-open .auth-suffix-chevron {
    color: #ffffff;
    background: var(--auth-navy-800);
    transform: rotate(180deg);
}

.auth-suffix-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
    border: 1px solid #d7e0ec;
    border-radius: 14px;
    background: #f8fafd;
    box-shadow: 0 16px 32px rgba(10, 27, 80, 0.14);
}

.auth-suffix-option {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #d9e2ee;
    border-radius: 10px;
    color: var(--auth-text);
    background: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    transition: border-color var(--auth-fast), color var(--auth-fast), background var(--auth-fast);
}

.auth-suffix-option i {
    opacity: 0;
    color: var(--auth-red);
    font-size: 0.42rem;
}

.auth-suffix-option:hover,
.auth-suffix-option:focus-visible,
.auth-suffix-option.is-selected {
    border-color: #9fb8eb;
    color: var(--auth-navy-800);
    background: #f0f5ff;
}

.auth-suffix-option.is-selected i {
    opacity: 1;
}

.phone-input-group {
    grid-template-columns: 48px 48px minmax(0, 1fr);
}

.phone-input-group .phone-prefix {
    height: 100%;
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 3px 0 8px;
    color: var(--auth-navy-800);
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity var(--auth-fast), transform var(--auth-fast);
}

.phone-input-group:focus-within .phone-prefix,
.phone-input-group.has-value .phone-prefix {
    opacity: 1;
    transform: translateY(0);
}

.phone-input-group input {
    grid-column: 3;
    padding-left: 2px;
}

.phone-input-group label {
    left: 62px;
}

.phone-input-group input::placeholder {
    color: #9aa6b8;
    opacity: 0;
    transition: opacity var(--auth-fast);
}

.phone-input-group:focus-within input::placeholder {
    opacity: 1;
}

.input-group label {
    position: absolute;
    left: 62px;
    top: 50%;

    max-width: calc(100% - 95px);

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: #728097;

    font-size: 0.79rem;
    font-weight: 500;

    pointer-events: none;

    transform: translateY(-50%);
    transform-origin: left center;

    transition:
        top var(--auth-fast),
        color var(--auth-fast),
        font-size var(--auth-fast),
        transform var(--auth-fast);
}

.input-group:focus-within label,
.input-group.has-value label {
    top: 8px;

    color: var(--auth-navy-700);

    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1.15;

    transform: translateY(0);
}

.input-group:focus-within label {
    color: var(--auth-red);
}

.input-focus-line {
    width: 0;
    height: 2px;

    position: absolute;
    left: 52px;
    bottom: 0;

    border-radius: 0 999px 999px 0;
    background: var(--auth-red);

    transition: width 300ms var(--auth-ease);
}

.input-group:focus-within .input-focus-line {
    width: calc(100% - 52px);
}

.toggle-password {
    width: 42px;
    height: 42px;

    position: absolute;
    top: 50%;
    right: 5px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    color: #718096;
    background: transparent;

    transform: translateY(-50%);

    transition:
        color var(--auth-fast),
        background var(--auth-fast),
        transform var(--auth-fast);
}

.toggle-password:hover {
    color: var(--auth-navy-900);
    background: var(--auth-soft);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.96);
}

/* =========================================================
   FORGOT PASSWORD
========================================================= */

.forgot-password {
    align-self: flex-end;

    margin-top: 1px;
    margin-bottom: 22px;

    color: var(--auth-navy-800);

    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;

    transition: color var(--auth-fast);
}

.forgot-password:hover {
    color: var(--auth-red);
}

.registration-password-rule {
    display: none !important;
    max-height: none !important;
    overflow: visible;
    margin: 1px 2px 10px;
    color: var(--auth-muted);
    font-size: 0.67rem;
    font-weight: 500;
    line-height: 1.5;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.registration-password-rule.is-visible { display: block !important; }

/* =========================================================
   TERMS
========================================================= */

.terms {
    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;
    gap: 11px;

    margin-bottom: 11px;
    padding: 9px 11px;

    border: 1px solid var(--auth-border);
    border-radius: 12px;

    background: var(--auth-soft);

    transition:
        border-color var(--auth-fast),
        background var(--auth-fast);
}

.terms:hover {
    border-color: var(--auth-border-strong);
    background: #ffffff;
}

.custom-checkbox {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;

    display: grid;
    place-items: center;

    border: 1px solid #c6d2e1;
    border-radius: 8px;

    color: #ffffff;
    background: #ffffff;

    cursor: pointer;

    transition:
        border-color var(--auth-fast),
        background var(--auth-fast),
        transform var(--auth-fast),
        box-shadow var(--auth-fast);
}

.custom-checkbox:hover,
.custom-checkbox:focus-visible {
    border-color: #9eafc8;
}

.custom-checkbox.active {
    border-color: var(--auth-navy-800);
    background: var(--auth-navy-800);
    box-shadow: 0 4px 10px rgba(10, 27, 80, 0.16);
}

.custom-checkbox i {
    opacity: 0;
    font-size: 0.70rem;
    transform: scale(0.6);
    transition: opacity var(--auth-fast), transform var(--auth-fast);
}

.custom-checkbox.active i {
    opacity: 1;
    transform: scale(1);
}

.terms-label {
    color: var(--auth-muted);

    font-size: 0.73rem;
    font-weight: 500;
    line-height: 1.45;
}

.terms-label a {
    color: var(--auth-navy-900);
    font-weight: 700;
    text-underline-offset: 2px;
}

.terms-label a:hover {
    color: var(--auth-red);
}

/* =========================================================
   PRIMARY BUTTON
========================================================= */

.auth-btn {
    width: 100%;
    min-height: 52px;

    position: relative;
    overflow: hidden;

    border-radius: 13px;

    color: #ffffff;
    background: var(--auth-navy-800);

    box-shadow: 0 12px 26px rgba(10, 27, 80, 0.16);

    transition:
        transform var(--auth-fast),
        background var(--auth-fast),
        box-shadow var(--auth-fast);
}

.auth-btn::before {
    content: "";

    width: 46px;
    height: 170%;

    position: absolute;
    top: -34%;
    left: -80px;
    z-index: 1;

    opacity: 0.68;
    background: rgba(255, 255, 255, 0.42);

    transform: rotate(18deg);
    filter: blur(1px);

    transition: left 560ms var(--auth-ease);
    pointer-events: none;
}

.auth-btn:hover:not(:disabled)::before,
.auth-btn:focus-visible:not(:disabled)::before {
    left: calc(100% + 55px);
}

.auth-btn:hover:not(:disabled),
.auth-btn:focus-visible:not(:disabled) {
    background: #0b205d;
    box-shadow: 0 15px 30px rgba(10, 27, 80, 0.20);
    transform: translateY(-1px);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.995);
}

.auth-btn-default,
.auth-btn-loading {
    position: relative;
    z-index: 2;

    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;
}

.auth-btn-default {
    justify-content: space-between;

    padding-left: 18px;
    padding-right: 7px;
}

.auth-btn-default > span {
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-btn-default > i {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.075);

    transition:
        background var(--auth-fast),
        border-color var(--auth-fast),
        transform var(--auth-fast);
}

.auth-btn:hover:not(:disabled) .auth-btn-default > i,
.auth-btn:focus-visible:not(:disabled) .auth-btn-default > i {
    border-color: var(--auth-red);
    background: var(--auth-red);
    transform: translateX(1px);
}

.auth-btn-loading {
    display: none;
    justify-content: center;
    gap: 10px;

    font-size: 0.80rem;
    font-weight: 700;
}

.auth-btn-loading i {
    animation: authSpin 800ms linear infinite;
}

.auth-btn.is-loading .auth-btn-default {
    display: none;
}

.auth-btn.is-loading .auth-btn-loading {
    display: flex;
}

.auth-btn:disabled {
    cursor: not-allowed;

    color: #9aa8ba;
    background: #eaf0f6;

    box-shadow: none;
}

.auth-btn:disabled::before {
    display: none;
}

.auth-button-ripple {
    width: 10px;
    height: 10px;

    position: absolute;
    z-index: 1;

    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);

    pointer-events: none;

    transform: translate(-50%, -50%) scale(0);
    animation: authRipple 720ms ease-out forwards;
}

/* =========================================================
   TOAST
========================================================= */

.auth-toast {
    width: min(390px, calc(100vw - 32px));

    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;

    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 11px;

    padding: 14px;

    border: 1px solid var(--auth-border);
    border-left: 4px solid var(--auth-info);
    border-radius: 14px;

    background: #ffffff;
    box-shadow: 0 18px 44px rgba(10, 27, 80, 0.15);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(14px);

    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 320ms var(--auth-ease);
}

.auth-toast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.auth-toast.success {
    border-left-color: var(--auth-success);
}

.auth-toast.error {
    border-left-color: var(--auth-danger);
}

.auth-toast-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    color: var(--auth-info);
    background: #eff6ff;
}

.auth-toast.success .auth-toast-icon {
    color: var(--auth-success);
    background: #edf9f2;
}

.auth-toast.error .auth-toast-icon {
    color: var(--auth-danger);
    background: #fff0f2;
}

.auth-toast-copy strong {
    display: block;
    margin-top: 1px;

    color: var(--auth-text);

    font-size: 0.80rem;
    font-weight: 800;
}

.auth-toast-copy p {
    margin-top: 3px;

    color: var(--auth-muted);

    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.5;
}

.auth-toast-close {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    color: #758199;
    background: transparent;

    transition: color var(--auth-fast), background var(--auth-fast);
}

.auth-toast-close:hover {
    color: var(--auth-red);
    background: #fff1f3;
}

/* =========================================================
   ANIMATION
========================================================= */

.form-panel.active .form-header,
.form-panel.active .input-group,
.form-panel.active .forgot-password,
.form-panel.active .terms,
.form-panel.active .auth-btn {
    animation: authElementRise 390ms var(--auth-ease) both;
}

.form-panel.active .input-group {
    animation-delay: 45ms;
}

.form-panel.active .forgot-password,
.form-panel.active .terms {
    animation-delay: 80ms;
}

.form-panel.active .auth-btn {
    animation-delay: 110ms;
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authElementRise {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authInputActivate {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.003);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes authRipple {
    from {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(32);
    }
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-height: 760px) and (min-width: 681px) {
    body.customer-auth-page {
        padding: 14px;
    }

    .auth-shell,
    .auth-shell.showing-sign-up {
        height: calc(100dvh - 28px);
        min-height: 0;
    }

    .auth-topbar {
        flex-basis: 66px;
        padding-top: 12px;
    }

    .auth-shared-header {
        padding-bottom: 11px;
    }

    .auth-logo-frame {
        width: 62px;
        height: 62px;
        margin-bottom: 12px;
    }

    .auth-logo {
        width: 62px;
        height: 62px;
    }

    .auth-business-name {
        margin-bottom: 11px;
        font-size: 0.72rem;
    }

    .auth-form {
        padding-bottom: 22px;
    }
}

@media (max-width: 680px) {
    body.customer-auth-page {
        overflow-y: auto;
        place-items: start center;
        padding: 12px;
    }

    .auth-shell,
    .auth-shell.showing-sign-up {
        width: 100%;
        height: calc(100dvh - 24px);
        min-height: 620px;

        border-radius: 20px;
    }

    .auth-topbar {
        flex: 0 0 68px;
        padding: 13px 16px 8px;
    }

    .back-home-text {
        display: none;
    }

    .back-home-icon {
        width: 36px;
        height: 36px;
    }

    .auth-wordmark-bar {
        height: 25px;
    }

    .auth-wordmark strong {
        font-size: 0.86rem;
    }

    .auth-shared-header {
        padding: 0 18px 14px;
    }

    .auth-logo-frame {
        width: 62px;
        height: 62px;
        margin-bottom: 13px;
    }

    .auth-logo {
        width: 46px;
        height: 46px;
    }

    .auth-mode-tabs {
        width: 100%;
    }

    .auth-mode-tab {
        font-size: 0.72rem;
    }

    .auth-form,
    .registration-form {
        padding: 2px 18px 24px;
    }

    .auth-form h1 {
        font-size: 1.65rem;
    }

    .name-grid,
    .password-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .name-grid .input-group,
    .password-grid .input-group {
        margin-bottom: 0;
    }

    .terms-label {
        font-size: 0.70rem;
    }

    .auth-toast {
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 390px) {
    .auth-topbar {
        padding-left: 13px;
        padding-right: 13px;
    }

    .auth-shared-header,
    .auth-form,
    .registration-form {
        padding-left: 14px;
        padding-right: 14px;
    }

    .auth-mode-tab {
        font-size: 0.68rem;
    }

    .input-group {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .input-icon {
        width: 48px;
    }

    .input-group label {
        left: 62px;
    }

    .input-focus-line {
        left: 48px;
    }

    .input-group:focus-within .input-focus-line {
        width: calc(100% - 48px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .auth-btn::before {
        display: none;
    }
}


/* =========================================================
   V19 CLEAN AUTH REFINEMENTS
   - keeps the top-right wordmark removed
   - keeps the BNT logo clean and container-free
   - adds the business name beneath the logo
   - gives the sign-in state more breathing room
========================================================= */

@media (min-width: 681px) {
    .auth-shell {
        max-width: 640px;
    }

    .auth-shell.showing-sign-up {
        max-width: 760px;
    }
}

@media (max-height: 760px) and (min-width: 681px) {
    .auth-shell {
        width: min(620px, calc(100% - 28px));
        height: calc(100dvh - 28px);
    }

    .auth-shell.showing-sign-up {
        width: min(740px, calc(100% - 28px));
        height: calc(100dvh - 28px);
    }

    .auth-topbar {
        flex-basis: 56px;
        padding-top: 10px;
    }

    .auth-shared-header {
        padding-bottom: 10px;
    }

    .auth-logo-frame {
        width: 78px;
        height: 78px;
        margin-bottom: 10px;
    }

    .auth-logo {
        width: 76px;
        height: 76px;
    }
}

@media (max-width: 680px) {
    .auth-shell,
    .auth-shell.showing-sign-up {
        width: 100%;
        max-width: 560px;
        height: auto;
        min-height: calc(100dvh - 24px);
    }

    .auth-topbar {
        flex-basis: 58px;
        padding: 11px 14px 7px;
    }

    .auth-logo-frame {
        width: 82px;
        height: 82px;
        margin-bottom: 11px;
    }

    .auth-logo {
        width: 80px;
        height: 80px;
    }

    .auth-business-name {
        margin-bottom: 13px;
        padding: 0 8px;
        font-size: 0.74rem;
        line-height: 1.4;
    }

    .auth-shared-header {
        padding: 0 16px 14px;
    }

    .auth-form,
    .registration-form {
        padding: 0 16px 22px;
    }
}


/* =========================================================
   V27 — CUSTOMER AUTH CLOSE INTERACTION
   Matches the Admin Audit/Gallery close-button interaction:
   soft red hover surface + smooth 90-degree rotation.
========================================================= */

.customer-auth-page .auth-toast-close {
    border: 1px solid #DCE4EF;

    color: #758199;
    background: #FFFFFF;

    box-shadow: none;

    transform: rotate(0deg) translateZ(0);
    transform-origin: center center;

    transition:
        transform 280ms cubic-bezier(.22, 1, .36, 1),
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 200ms ease;
}

.customer-auth-page .auth-toast-close:hover,
.customer-auth-page .auth-toast-close:focus-visible {
    color: #D72638;

    border-color: #F0C7C7;
    background: #FFF7F7;

    box-shadow:
        0 5px 14px
        rgba(15, 23, 42, .055);

    transform:
        rotate(90deg)
        translateZ(0);

    outline: none;
}

.customer-auth-page .auth-toast-close:active {
    transform:
        rotate(90deg)
        scale(.93)
        translateZ(0);
}

.customer-auth-page .auth-toast-close i {
    font-size: .72rem;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    .customer-auth-page .auth-toast-close {
        transition: none !important;
    }

    .customer-auth-page .auth-toast-close:hover,
    .customer-auth-page .auth-toast-close:focus-visible,
    .customer-auth-page .auth-toast-close:active {
        transform: none !important;
    }
}


/* =========================================================
   V28 — CUSTOMER AUTH TOAST POSITION
   Move login / validation toasts from the lower-right to the
   upper-right, matching the administrator authentication UI.
   Presentation-only; no login or redirect logic is changed.
========================================================= */

.customer-auth-page .auth-toast {
    top: 22px;
    right: 22px;
    bottom: auto;
    left: auto;

    z-index: 100000;

    transform: translateY(-12px);
}

.customer-auth-page .auth-toast.show {
    transform: translateY(0);
}


/* Keep toast content vertically balanced. */

.customer-auth-page .auth-toast {
    align-items: center;
}

.customer-auth-page .auth-toast-copy {
    min-width: 0;
}

.customer-auth-page .auth-toast-copy strong,
.customer-auth-page .auth-toast-copy p {
    margin-left: 0;
    margin-right: 0;
}


/* Tablet / mobile: keep it at the TOP, not the bottom. */

@media (max-width: 720px) {
    .customer-auth-page .auth-toast {
        top: 14px;
        right: 14px;
        bottom: auto;
        left: 14px;

        width: auto;
        max-width: none;
    }
}

@media (max-width: 390px) {
    .customer-auth-page .auth-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        bottom: auto;
    }
}
