/* ==========================================================================
   BABAEI AUTH — immersive liquid access
   Based on the uploaded Mercury/Neural Access direction, adapted to the
   storefront palette and the real phone -> OTP backend flow.
   ========================================================================== */

.auth-body {
    --auth-bg: var(--sh-cream);
    --auth-forest: var(--sh-forest);
    --auth-deep: var(--sh-forest-deep);
    --auth-soft: var(--sh-forest-soft);
    --auth-cream: var(--sh-cream-2);
    --auth-ink: var(--sh-ink);
    --auth-dim: rgba(20, 22, 26, .48);
    --auth-line: rgba(20, 22, 26, .14);

    background: var(--auth-bg);
    color: var(--auth-ink);
    overflow-x: hidden;
}

.auth-body .babaei-quick-actions,
.auth-body .sh-dock,
.auth-body .mobile-menu {
    display: none !important;
}

.auth-body main {
    min-height: 100svh;
}

.auth-page {
    position: relative;
    isolation: isolate;

    min-height: 100svh;
    width: 100%;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at 50% 50%, rgba(20,82,60,.045), transparent 52%),
        var(--auth-bg);
}

/* --------------------------------------------------------------------------
   Auth-only base reset
   -------------------------------------------------------------------------- */

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

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sh-font);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-body a {
    color: inherit;
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   Auth messages
   -------------------------------------------------------------------------- */

.auth-body > .messages {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 80;

    width: min(calc(100% - 32px), 470px);
    margin: 0;

    transform: translateX(-50%);
    pointer-events: none;
}

.auth-body > .messages .toast {
    position: relative;

    display: flex;
    align-items: center;
    gap: 11px;

    min-height: 50px;
    padding: 12px 15px 12px 17px;

    border: 1px solid rgba(20,22,26,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.94);

    color: #30343a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.8;
    text-align: right;

    box-shadow:
        0 18px 50px rgba(20,22,26,.10),
        0 2px 8px rgba(20,22,26,.05);

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    pointer-events: auto;
    animation: auth-message-in .42s cubic-bezier(.22,1,.36,1) both;
}

.auth-body > .messages .toast::before {
    content: "!";

    flex: 0 0 24px;
    width: 24px;
    height: 24px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.auth-body > .messages .toast-error,
.auth-body > .messages .toast-danger {
    border-color: rgba(171,67,67,.16);
}

.auth-body > .messages .toast-error::before,
.auth-body > .messages .toast-danger::before {
    background: rgba(171,67,67,.10);
    color: #a33f3f;
}

.auth-body > .messages .toast-success {
    border-color: rgba(20,82,60,.16);
}

.auth-body > .messages .toast-success::before {
    content: "✓";
    background: rgba(20,82,60,.10);
    color: var(--auth-forest);
}

@keyframes auth-message-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --------------------------------------------------------------------------
   Liquid background
   -------------------------------------------------------------------------- */

.auth-liquid {
    position: absolute;
    inset: 0;
    z-index: 0;

    overflow: hidden;
    pointer-events: none;

    filter: blur(6px);
    opacity: .72;
}

.auth-blob {
    position: absolute;
    will-change: transform;

    width: 220px;
    height: 220px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 30% 28%,
            rgba(251,250,247,.92),
            rgba(143,174,156,.44) 34%,
            rgba(20,82,60,.70) 78%
        );

    box-shadow:
        inset -24px -28px 40px rgba(9,28,20,.16),
        inset 18px 16px 34px rgba(255,255,255,.50),
        0 22px 60px rgba(9,28,20,.11);

    animation: auth-float 20s infinite alternate ease-in-out;
    transition: margin .10s ease-out;
}

.auth-blob--1 {
    width: 340px;
    height: 340px;
    left: 8%;
    top: 12%;
    animation-duration: 23s;
    animation-delay: -8s;
}

.auth-blob--2 {
    width: 250px;
    height: 250px;
    left: 68%;
    top: 10%;
    animation-duration: 18s;
    animation-delay: -12s;
}

.auth-blob--3 {
    width: 310px;
    height: 310px;
    left: 54%;
    top: 60%;
    animation-duration: 25s;
    animation-delay: -4s;
}

.auth-blob--4 {
    width: 180px;
    height: 180px;
    left: 18%;
    top: 68%;
    animation-duration: 17s;
    animation-delay: -5s;
}

.auth-blob--5 {
    width: 260px;
    height: 260px;
    left: 40%;
    top: 22%;
    animation-duration: 21s;
    animation-delay: -14s;
}

.auth-blob--6 {
    width: 150px;
    height: 150px;
    left: 82%;
    top: 70%;
    animation-duration: 16s;
    animation-delay: -7s;
}

@keyframes auth-float {
    0% {
        transform: translate(0,0) scale(1);
    }

    33% {
        transform: translate(8vw,16vh) scale(1.16);
    }

    66% {
        transform: translate(-5vw,8vh) scale(.84);
    }

    100% {
        transform: translate(4vw,-8vh) scale(1.08);
    }
}

.auth-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .22;
}

.auth-grid span {
    position: absolute;
    top: 0;
    bottom: 0;

    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(20,82,60,.10) 20%,
        rgba(20,82,60,.16) 50%,
        transparent 80%
    );
}

.auth-grid span:nth-child(1) { right: 18%; }
.auth-grid span:nth-child(2) { right: 38%; }
.auth-grid span:nth-child(3) { left: 38%; }
.auth-grid span:nth-child(4) { left: 18%; }

/* --------------------------------------------------------------------------
   Interface
   -------------------------------------------------------------------------- */

.auth-container {
    position: relative;
    z-index: 5;

    width: min(100%, 470px);
    padding: 42px 32px 34px;
}

.auth-header {
    margin-bottom: 54px;
    text-align: right;
}

.auth-brand-id {
    display: block;

    margin-bottom: 11px;

    color: var(--auth-dim);

    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .24em;

    direction: ltr;
    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0;

    color: var(--auth-deep);

    font-size: clamp(48px, 7vw, 76px);
    font-weight: 850;
    line-height: .88;
    letter-spacing: -.065em;

    direction: ltr;
    text-align: right;
}

.auth-header h1 strong {
    color: var(--auth-ink);
    font-weight: 850;
}

.auth-header p {
    max-width: 30ch;

    margin: 18px 0 0;

    color: var(--sh-muted);
    font-size: 13px;
    line-height: 2.1;
}

.auth-header p b {
    color: var(--auth-forest);
    font-weight: 800;
}

/* --------------------------------------------------------------------------
   Form — line based like the reference
   -------------------------------------------------------------------------- */

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form-group {
    position: relative;
    margin-bottom: 30px;

    transition: transform .4s cubic-bezier(.2,1,.3,1);
}

/* Phone entry mirrors the centered Verify alignment. */
.auth-page:not(.auth-page--verify) .auth-header {
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-brand-id {
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-header h1 {
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-header p {
    margin-inline: auto;
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-form-group {
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-phone-line {
    width: min(100%, 520px);
    margin-inline: auto;
}

.auth-page:not(.auth-page--verify) .auth-phone-line input {
    text-align: center;
}

.auth-page:not(.auth-page--verify) .auth-phone-prefix {
    margin-inline-end: 0;
}

.auth-page:not(.auth-page--verify) .auth-input-glow {
    inset-inline-start: 50%;
    transform: translateX(-50%);
}

.auth-form-group:focus-within {
    transform: translateX(-8px);
}

.auth-form-group label {
    display: block;

    margin-bottom: 12px;

    color: var(--auth-dim);

    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .10em;

    text-transform: uppercase;
}

.auth-phone-line {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 54px;

    border-bottom: 1px solid var(--auth-line);

    direction: ltr;
}

.auth-phone-prefix {
    flex: 0 0 auto;

    margin-inline-end: 16px;

    color: var(--auth-dim);

    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
}

.auth-phone-line input {
    width: 100%;

    padding: 11px 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--auth-ink);

    font-size: 19px;
    font-weight: 700;

    text-align: left;
}

.auth-phone-line input::placeholder {
    color: rgba(109,114,120,.60);
    font-weight: 500;
}

.auth-input-glow {
    position: absolute;
    inset-block-end: -1px;
    inset-inline-start: 0;

    width: 0%;
    height: 2px;

    background: var(--auth-forest);

    box-shadow: 0 0 18px rgba(20,82,60,.46);

    transition: width .55s cubic-bezier(.2,1,.3,1);
}

.auth-phone-line:focus-within .auth-input-glow {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Liquid action
   -------------------------------------------------------------------------- */

.auth-submit-wrap {
    position: relative;
    margin-top: 20px;

    filter: url("#auth-gooey");
}

.auth-submit-liquid {
    position: absolute;
    inset: 50% auto auto 50%;

    width: 100%;
    height: 100%;

    transform: translate(-50%,-50%);

    border-radius: 999px;

    background:
        radial-gradient(circle at 30% 30%, var(--auth-soft), var(--auth-forest));

    box-shadow:
        0 16px 34px rgba(20,82,60,.22),
        inset 0 1px 0 rgba(255,255,255,.18);

    transition:
        transform .5s cubic-bezier(.175,.885,.32,1.275),
        filter .35s ease;
}

.auth-submit {
    position: relative;
    z-index: 2;

    width: 100%;
    min-height: 62px;

    padding: 18px 24px;

    border: 1px solid rgba(251,250,247,.14);
    border-radius: 18px;

    background: var(--auth-forest);
    color: var(--auth-cream);

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 14px;
    font-weight: 850;

    cursor: pointer;

    transition:
        letter-spacing .30s ease,
        transform .25s ease,
        background .25s ease;
}

.auth-submit:hover {
    letter-spacing: .03em;
    transform: translateY(-1px);
    background: var(--auth-soft);
}

.auth-submit-wrap:hover .auth-submit-liquid {
    transform: translate(-50%,-50%) scale(1.035,1.12);
    filter: brightness(1.07);
}

.auth-submit strong {
    font-family: "Courier New", monospace;
    font-size: 17px;
    font-weight: 700;
    direction: ltr;
}

.auth-footer-nav {
    margin-top: 34px;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.auth-store-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    min-height: 44px;
    padding: 0 16px;

    border: 1px solid rgba(20,82,60,.18);
    border-radius: 12px;
    background: rgba(251,250,247,.72);

    color: var(--auth-forest);
    font-family: var(--sh-font);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;

    box-shadow: 0 8px 20px rgba(9,28,20,.06);

    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

.auth-store-link strong {
    font-family: "Courier New", monospace;
    font-size: 15px;
    line-height: 1;
    direction: ltr;
    transition: transform .25s ease;
}

.auth-store-link:hover {
    background: var(--auth-forest);
    color: var(--auth-cream);
    border-color: var(--auth-forest);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(20,82,60,.14);
}

.auth-store-link:hover strong {
    transform: translateX(-3px);
}

.auth-change-link {
    color: var(--sh-muted);
    font-size: 10px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(109,114,120,.30);
    text-underline-offset: 4px;
}

.auth-change-link:hover {
    color: var(--auth-forest);
    text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   OTP
   -------------------------------------------------------------------------- */

.auth-page--verify .auth-container {
    width: min(100%, 560px);
}

.auth-page--verify .auth-header {
    margin-bottom: 48px;
}

.auth-otp-line {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 14px;

    direction: ltr;
}

.auth-otp-cell {
    position: relative;
}

.auth-otp-cell input {
    width: 100%;
    height: 60px;

    padding: 8px 0;

    border: 0;
    border-bottom: 1px solid var(--auth-line);
    outline: 0;

    background: transparent;

    color: var(--auth-ink);

    font-family: "Courier New", monospace;
    font-size: 30px;
    font-weight: 800;

    text-align: center;
}

.auth-otp-cell > span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    width: 0;
    height: 2px;

    background: var(--auth-forest);

    box-shadow: 0 0 18px rgba(20,82,60,.45);

    transition: width .5s cubic-bezier(.2,1,.3,1);
}

.auth-otp-cell:focus-within > span {
    width: 100%;
}

.auth-resend {
    margin-top: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    font-size: 10px;
}

.auth-resend span {
    color: var(--auth-dim);
}

.auth-resend a {
    color: var(--auth-forest);
    font-family: "Courier New", monospace;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 700px) {
    /* Keep mobile compositor work small: the first three blobs provide the full
       depth effect without six large blurred layers moving simultaneously. */
    .auth-blob--4,
    .auth-blob--5,
    .auth-blob--6 {
        display: none;
    }

    /* Mobile auth is a fixed viewport: no page dragging/vertical scrolling. */
    .auth-body {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .auth-body main {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
    }

    .auth-page {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
    }

    .auth-container {
        width: min(100%, 440px);
        padding: 34px 20px 26px;
        transform: translateY(92px);
    }

    .auth-header {
        margin-bottom: 42px;
    }

    .auth-header h1 {
        font-size: 52px;
    }

    .auth-blob--1 { left: -8%; top: 8%; }
    .auth-blob--2 { left: 72%; top: 14%; }
    .auth-blob--3 { left: 52%; top: 64%; }

    .auth-grid span:nth-child(1) { right: 10%; }
    .auth-grid span:nth-child(2) { right: 28%; }
    .auth-grid span:nth-child(3) { left: 28%; }
    .auth-grid span:nth-child(4) { left: 10%; }

    .auth-form-group:focus-within {
        transform: none;
    }

    .auth-otp-line {
        gap: 8px;
    }

    .auth-otp-cell input {
        font-size: 24px;
        height: 54px;
    }
}

@media (max-width: 420px) {
    .auth-container {
        padding-inline: 16px;
    }

    .auth-header h1 {
        font-size: 45px;
    }

    .auth-brand-id {
        font-size: 8px;
    }

    .auth-footer-nav {
        font-size: 8px;
    }

    .auth-submit {
        min-height: 58px;
    }

    .auth-otp-line {
        gap: 6px;
    }

    .auth-otp-cell input {
        font-size: 21px;
        height: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-blob {
        animation: none;
        transition: none;
    }

    .auth-form-group,
    .auth-input-glow,
    .auth-submit,
    .auth-submit-liquid,
    .auth-container,
    .otp-digit,
    .auth-otp-cell > span {
        transition: none;
    }
}


.auth-container[data-auth-transition="leave"] {
    transform: translate3d(-42px, 0, 0);
    opacity: 0;
    pointer-events: none;
}

.auth-container[data-auth-transition="enter"] {
    animation: auth-container-enter 500ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes auth-container-enter {
    from {
        opacity: 0;
        transform: translate3d(42px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.auth-svg-filter {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}


/* Verify: centered, single-line English heading and centered SMS copy. */
.auth-page--verify .auth-header {
    text-align: center;
}

.auth-page--verify .auth-brand-id {
    text-align: center;
}

.auth-page--verify .auth-header h1 {
    text-align: center;
    white-space: nowrap;
    font-size: clamp(44px, 6vw, 72px);
    line-height: .95;
    direction: ltr;
}

.auth-page--verify .auth-header h1 strong {
    display: inline;
}

.auth-page--verify .auth-header p {
    max-width: none;
    margin-inline: auto;
    text-align: center;
    white-space: nowrap;
}

.auth-page--verify .auth-form-group--otp {
    text-align: center;
}

.auth-page--verify .auth-otp-line {
    width: min(100%, 520px);
    margin-inline: auto;
}

.auth-page--verify .auth-form-group--otp > small {
    display: block;
    margin-top: 12px;
    color: var(--sh-muted);
    font-size: 10px;
    text-align: center;
}

@media (max-width: 700px) {
    .auth-page--verify .auth-header h1 {
        font-size: clamp(38px, 12vw, 52px);
    }

    .auth-page--verify .auth-header p {
        white-space: nowrap;
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .auth-page--verify .auth-header h1 {
        font-size: 36px;
    }

    .auth-page--verify .auth-header p {
        font-size: 10px;
    }
}
