/* Business portal guest screen */

#guest {
    --auth-gold: #c9a227;
    --auth-gold-hi: #e0b83c;
    --auth-gold-lo: #bf961c;
    --auth-field: #222d40;
    --auth-card: #151e2e;
    --auth-edge: rgba(255, 255, 255, 0.12);
    --auth-text: #ffffff;
    --auth-dim: rgba(226, 232, 240, 0.72);
}

body:has(#guest:not([hidden])) {
    background: #0d111a !important;
    color: #fff !important;
}

body:has(#guest:not([hidden])) .portal-topbar {
    display: none !important;
}

#guest.auth-split {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    align-items: stretch;
    max-width: none;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0;
    background: #07152e;
}

#guest.auth-split[hidden],
#guest .field[hidden] {
    display: none;
}

#guest.auth-split::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 0 18%;
    background:
        linear-gradient(90deg, #07152e, #07152e7a 25%, transparent 72%),
        linear-gradient(180deg, #061735b0, #06173555 38%, transparent 76%),
        url("/images/mahalla-business-night.jpg") 15% center / cover no-repeat;
}

.auth-hero {
    align-self: center;
    justify-self: end;
    width: min(100%, 37rem);
    padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 2.5rem 0;
    text-shadow: 0 2px 16px #041128bf;
}

#guest .auth-hero h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 3.45vw, 3.5rem);
    font-weight: 900;
    letter-spacing: normal;
    line-height: 1.32;
}

.auth-hero h2 span { color: var(--auth-gold-hi); }

.auth-hero h2::after {
    content: "";
    display: block;
    width: 4.5rem;
    height: 3px;
    margin: 1.1rem 0;
    border-radius: 2px;
    background: var(--auth-gold-hi);
}

.auth-hero p {
    max-width: 25rem;
    margin: 0;
    color: #e2e8f0;
    font-size: clamp(.95rem, 1.25vw, 1.18rem);
    line-height: 1.8;
}

.auth-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin: 1.4rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-tiles li {
    display: grid;
    justify-items: center;
    gap: .4rem;
    min-width: 6.15rem;
    padding: .65rem .6rem;
    border: 1px solid #e3ebff26;
    border-radius: 12px;
    background: linear-gradient(155deg, #243655d9, #0d1933e8);
    box-shadow: inset 0 1px 0 #fff1, 0 8px 20px #050c2255;
    backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: .78rem;
    font-weight: 700;
}

.auth-tiles svg {
    width: 1.6rem;
    height: 1.6rem;
    color: var(--auth-gold-hi);
    filter: drop-shadow(0 2px 6px #e0b83c55);
}

@media (prefers-reduced-motion: no-preference) {
    .auth-tiles svg {
        animation: auth-icon-float 4.8s ease-in-out infinite;
    }

    .auth-tiles li:nth-child(2) svg { animation-delay: -.8s; }
    .auth-tiles li:nth-child(3) svg { animation-delay: -1.6s; }

    @keyframes auth-icon-float {
        0%, 100% { transform: translateY(1px); }
        50% { transform: translateY(-3px); filter: drop-shadow(0 3px 9px #ffd765a0); }
    }
}

.auth-side {
    position: relative;
    align-self: center;
    justify-self: center;
    display: flex;
    flex-direction: column;
    width: min(calc(100% - 2rem), 27rem);
    margin: 1.5rem 0;
    padding: 2rem clamp(1.1rem, 2.5vw, 2.25rem) 1.65rem;
    border: 1px solid #242f41;
    border-radius: 24px;
    background: #101b32ed;
    box-shadow: 0 30px 70px -30px #000b;
}

.auth-side::before {
    content: "";
    position: absolute;
    inset: 0 1.25rem auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--auth-gold), transparent);
}

.auth-card-logo {
    align-self: center;
    margin-bottom: .85rem;
}

.auth-card-logo img {
    display: block;
    width: auto;
    height: 3.5rem;
}

:root #guest.auth-split .panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--auth-text) !important;
}

:root #guest.auth-split #auth-title {
    order: 1;
    margin: 0;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.35;
    color: #fff;
}

:root #guest.auth-split #auth-note {
    order: 2;
    margin: .2rem 0 1rem;
    text-align: center;
    font-size: .875rem;
    line-height: 1.8;
    color: var(--auth-dim);
}

:root #guest.auth-split #auth-form {
    order: 4;
}

:root #guest.auth-split .panel .actions {
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 1rem;
    padding: 4px;
    border: 1px solid var(--auth-edge);
    border-radius: 12px;
    background: #0d1422 !important;
}

:root #guest.auth-split .panel .actions .secondary {
    min-height: 2.5rem;
    padding: .3rem;
    background: transparent !important;
    color: #bdcce0 !important;
    font-size: .875rem;
    font-weight: 700;
    box-shadow: none !important;
}

:root #guest.auth-split .panel .actions .secondary:hover,
:root #guest.auth-split .panel .actions .secondary.active {
    background: #26374d !important;
    color: #e5f4ff !important;
}

:root #guest.auth-split .panel .actions .secondary.active {
    box-shadow: inset 0 0 0 1px #4d7095 !important;
}

#guest button:focus-visible,
#guest a:focus-visible {
    outline: 2px solid #a4dbff;
    outline-offset: 3px;
}

:root #guest.auth-split .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

:root #guest.auth-split .field {
    gap: .3rem;
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

:root #guest.auth-split .field input,
:root #guest.auth-split .field select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0 1.2rem;
    border: 1px solid var(--auth-edge) !important;
    border-radius: 12px !important;
    background: var(--auth-field) !important;
    color: #fff !important;
    font-size: 1rem;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

:root #guest.auth-split .field select option {
    background: var(--auth-card);
}

:root #guest.auth-split .field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

:root #guest.auth-split .field input:focus,
:root #guest.auth-split .field select:focus {
    border-color: var(--auth-gold) !important;
    background: #26334a !important;
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.14) !important;
}

/* Browser autofill keeps the dark field instead of its own pale fill. */
:root #guest.auth-split .field input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    box-shadow: inset 0 0 0 100px #26334a !important;
    caret-color: #fff;
}

/* Icon on the physical left (where LTR text starts), eye on the right. */
.auth-input {
    position: relative;
    display: block;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 1.05rem;
    width: 1.3rem;
    height: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    transform: translateY(-50%);
    pointer-events: none;
}

:root #guest.auth-split .auth-input input {
    padding-left: 3.25rem;
}

:root #guest.auth-split .auth-pass input {
    padding-right: 3.25rem;
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-eye:hover {
    color: var(--auth-gold);
}

.auth-eye svg {
    width: 1.3rem;
    height: 1.3rem;
}

.auth-eye-hide,
.auth-eye.is-on .auth-eye-show {
    display: none;
}

.auth-eye.is-on .auth-eye-hide {
    display: block;
}

:root #guest.auth-split .primary[type="submit"] {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.9rem;
    margin-top: .85rem;
    border: 0;
    border-radius: 12px !important;
    background: linear-gradient(110deg, var(--auth-gold-hi), var(--auth-gold-lo)) !important;
    color: #1a1204 !important;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 14px 30px -12px rgba(201, 162, 39, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

:root #guest.auth-split .primary[type="submit"]:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -12px rgba(201, 162, 39, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

:root #guest.auth-split .primary[type="submit"]:disabled {
    opacity: 0.7;
    transform: none;
}

:root #guest.auth-split .error:not(:empty) {
    margin-top: .65rem;
}

#guest #auth-error:empty {
    display: none;
}

/* Continue with Google: a divider, then Google's own button. */
:root #guest.auth-split .auth-google {
    order: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

:root #guest.auth-split .auth-google[hidden] {
    display: none;
}

.auth-or {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.auth-google-wrap {
    position: relative;
    width: 100%;
    height: 2.75rem;
}

.auth-google-face {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-google-logo {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.auth-google-logo svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* Google's iframe covers the face, so hover is read from the wrapper. */
.auth-google-wrap:hover .auth-google-face {
    border-color: rgba(201, 162, 39, 0.65);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 24px -14px rgba(201, 162, 39, 0.6);
    transform: translateY(-1px);
}

.auth-google-wrap:focus-within .auth-google-face {
    border-color: var(--auth-gold);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.18);
}

.auth-google-hit {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.001;
    transform-origin: 0 0;
    overflow: hidden;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: center;
    margin-top: 1rem;
    font-size: .85rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-back svg {
    width: 1.15rem;
    height: 1.15rem;
}

.auth-back:hover {
    color: var(--auth-gold);
}

@media (max-width: 1023.98px) {
    #guest.auth-split {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    #guest.auth-split::before {
        inset: 0 0 auto;
        height: 19rem;
        background:
            linear-gradient(0deg, #07152e, #07152e45 70%),
            url("/images/mahalla-business-night.jpg") 62% 30% / cover no-repeat;
    }

    .auth-hero {
        align-self: start;
        justify-self: stretch;
        width: auto;
        min-height: 12.5rem;
        display: flex;
        align-items: flex-end;
        padding: 1.25rem;
    }

    #guest .auth-hero h2 { font-size: clamp(1.3rem, 4.6vw, 1.85rem); }
    .auth-hero h2::after,
    .auth-hero p,
    .auth-tiles { display: none; }

    .auth-side {
        align-self: start;
        margin-top: 0;
        padding-top: 1.25rem;
    }

    .auth-card-logo img { height: 2.65rem; }
}

@media (prefers-reduced-motion: reduce) {
    #guest * { transition: none !important; }
}
