
/* =========================================================
   MAHERA JEWELS - AUTH POPUP
========================================================= */

.mj-auth-overlay,
.mj-auth-overlay * {
    box-sizing: border-box;
}

.mj-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, .72);
    overscroll-behavior: contain;
}

.mj-auth-overlay[hidden],
.mj-auth-screen[hidden],
.mj-auth-password-toggle svg[hidden] {
    display: none !important;
}

.mj-auth-modal {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 1000px;
    max-height: min(760px, calc(100vh - 48px));
    min-height: 560px;
    margin: auto;
    overflow: hidden;
    border-radius: var(--mj-radius-lg);
    background: var(--mj-surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.mj-auth-close {
    position: absolute;
    top: 13px;
    right: 15px;
    z-index: 10;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mj-surface);
    color: var(--mj-text);
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.mj-auth-close:hover {
    background: var(--mj-background);
    color: var(--mj-primary);
}

/* VISUAL */

.mj-auth-visual {
    position: relative;
    display: flex;
    flex: 1 1 50%;
    min-width: 0;
    min-height: 560px;
    overflow: hidden;
    background: var(--mj-primary-deep);
}

.mj-auth-visual > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mj-auth-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, .28), var(--mj-primary-deep));
    opacity: .78;
}

.mj-auth-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 42px;
    color: var(--mj-white);
    text-align: center;
}

.mj-auth-brand {
    margin-bottom: 32px;
    color: var(--mj-white);
    font-family: var(--mj-font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 4px;
}

.mj-auth-visual-content h1 {
    margin: 0 0 15px;
    color: var(--mj-white);
    font-family: var(--mj-font-display);
    font-size: clamp(30px, 4vw, 43px);
    font-weight: 700;
    line-height: 1.2;
}

.mj-auth-visual-content p {
    max-width: 340px;
    margin: 0;
    color: var(--mj-white);
    font-size: 14px;
    line-height: 1.75;
}

/* FORM CONTENT */

.mj-auth-content {
    display: flex;
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    padding: 58px 44px 42px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--mj-surface);
}

.mj-auth-screen {
    width: 100%;
    max-width: 360px;
    margin: auto;
}

.mj-auth-screen h2 {
    margin: 0;
    color: var(--mj-primary);
    font-family: var(--mj-font-display);
    font-size: 29px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.mj-auth-subtitle {
    margin: 10px 0 27px;
    color: var(--mj-muted);
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
}

.mj-auth-subtitle strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--mj-primary);
    font-weight: 600;
}

/* FIELDS */

.mj-auth-field {
    margin-bottom: 17px;
}

.mj-auth-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--mj-text);
    font-size: 12px;
    font-weight: 600;
}

.mj-auth-field input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--mj-border);
    border-radius: var(--mj-radius-md);
    outline: none;
    background: var(--mj-white);
    color: var(--mj-text);
    font-family: var(--mj-font-body);
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mj-auth-field input::placeholder {
    color: var(--mj-muted);
    opacity: .8;
}

.mj-auth-field input:focus {
    border-color: var(--mj-primary);
    box-shadow: 0 0 0 3px rgba(80, 0, 47, .08);
}

/* PASSWORD */

.mj-auth-password {
    position: relative;
    width: 100%;
}

.mj-auth-password input {
    padding-right: 52px;
}

.mj-auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mj-muted);
    cursor: pointer;
}

.mj-auth-password-toggle:hover {
    background: var(--mj-background);
    color: var(--mj-primary);
}

.mj-auth-password-toggle svg {
    display: block;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* LINKS */

.mj-auth-forgot {
    display: flex;
    justify-content: flex-end;
    margin: -5px 0 17px;
}

.mj-auth-forgot button,
.mj-auth-switch button,
.mj-auth-resend button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--mj-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.mj-auth-forgot button:hover,
.mj-auth-switch button:hover,
.mj-auth-resend button:hover {
    text-decoration: underline;
}

/* SUBMIT */

.mj-auth-submit {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    padding: 12px 18px;
    border: 0;
    border-radius: var(--mj-radius-md);
    background: var(--mj-primary);
    color: var(--mj-white);
    font-family: var(--mj-font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;
}

.mj-auth-submit:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
}

.mj-auth-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* SWITCH */

.mj-auth-switch {
    margin: 22px 0 0;
    color: var(--mj-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.mj-auth-switch button {
    margin-left: 3px;
}

/* MESSAGE ALERTS */

.mj-auth-message {
    display: block;
    width: 100%;
    margin: 0 0 16px;
}

.mj-auth-message:empty {
    display: none;
}

.mj-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--mj-radius-md);
    font-family: var(--mj-font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
    animation: mj-auth-alert-in .2s ease-out;
}

.mj-auth-alert::before {
    display: inline-flex;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.mj-auth-alert-error {
    border-color: var(--mj-error);
    background: var(--mj-background);
    color: var(--mj-error);
}

.mj-auth-alert-error::before {
    content: "!";
    background: var(--mj-error);
    color: var(--mj-white);
}

.mj-auth-alert-success {
    border-color: var(--mj-success);
    background: var(--mj-background);
    color: var(--mj-success);
}

.mj-auth-alert-success::before {
    content: "✓";
    background: var(--mj-success);
    color: var(--mj-white);
}

/* FIELD VALIDATION */

.mj-auth-field input.mj-auth-invalid {
    border-color: var(--mj-error) !important;
    box-shadow: 0 0 0 3px rgba(180, 30, 50, .08);
}

.mj-auth-field input.mj-auth-valid {
    border-color: var(--mj-success) !important;
}

.mj-auth-field-error {
    display: block;
    margin-top: 6px;
    color: var(--mj-error);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.mj-auth-field-success {
    display: block;
    margin-top: 6px;
    color: var(--mj-success);
    font-size: 11px;
    font-weight: 600;
}

/* OTP */

.mj-auth-timer {
    margin: -4px 0 15px;
    color: var(--mj-muted);
    font-size: 12px;
    text-align: center;
}

.mj-auth-resend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 19px;
    color: var(--mj-muted);
    font-size: 12px;
    text-align: center;
}

.mj-auth-resend button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

@keyframes mj-auth-alert-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* TABLET */

@media (max-width: 900px) {
    .mj-auth-modal {
        max-width: 760px;
        min-height: 520px;
    }

    .mj-auth-visual {
        min-height: 520px;
    }

    .mj-auth-content {
        padding: 54px 30px 32px;
    }

    .mj-auth-visual-content {
        padding: 28px;
    }
}

/* MOBILE */

@media (max-width: 680px) {
    .mj-auth-overlay {
        align-items: center;
        padding: 12px;
    }

    .mj-auth-modal {
        display: block;
        width: 100%;
        max-width: 440px;
        max-height: calc(100dvh - 24px);
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: var(--mj-radius-lg);
    }

    .mj-auth-visual {
        display: none;
    }

    .mj-auth-content {
        display: block;
        width: 100%;
        min-height: 0;
        padding: 54px 24px 30px;
        overflow: visible;
    }

    .mj-auth-screen {
        max-width: 400px;
        margin: 0 auto;
    }

    .mj-auth-screen h2 {
        font-size: 25px;
    }

    .mj-auth-subtitle {
        margin-bottom: 23px;
    }

    .mj-auth-close {
        top: 9px;
        right: 9px;
        width: 34px;
        height: 34px;
    }
}

/* SMALL MOBILE */

@media (max-width: 380px) {
    .mj-auth-overlay {
        padding: 8px;
    }

    .mj-auth-modal {
        max-height: calc(100dvh - 16px);
    }

    .mj-auth-content {
        padding: 50px 17px 24px;
    }

    .mj-auth-screen h2 {
        font-size: 23px;
    }

    .mj-auth-field input {
        min-height: 46px;
        font-size: 12px;
    }

    .mj-auth-submit {
        min-height: 46px;
    }
}

/* SHORT DESKTOP */

@media (min-width: 681px) and (max-height: 650px) {
    .mj-auth-overlay {
        align-items: flex-start;
    }

    .mj-auth-modal {
        min-height: 0;
        max-height: calc(100vh - 32px);
    }

    .mj-auth-visual {
        min-height: 500px;
    }

    .mj-auth-content {
        justify-content: flex-start;
        padding-top: 54px;
        padding-bottom: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mj-auth-alert,
    .mj-auth-submit,
    .mj-auth-field input {
        animation: none;
        transition: none;
    }
}
