/* =================================================================
   MAYOCOO public-site authentication pages
   Shared by: Wakala portal login / forgot password / sign-up and the
   admin login. Uses the public Bootstrap theme (assets/css/style.css)
   so the header, footer and brand language match the main website.
   ================================================================= */

.auth-public-page {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    background-color: var(--bs-body-bg);
}

/* The public navbar is absolute on marketing pages. Auth pages need it
   in normal flow so the form can be vertically centred underneath. */
.auth-public-page header.header-absolute {
    position: relative;
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, .08));
}

.auth-public-page .navbar {
    --bs-navbar-brand-padding-y: 14px;
}

.auth-public-page .navbar-brand-item {
    height: 40px;
    width: auto;
}

.auth-public-main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    padding: clamp(1rem, 3vh, 2.25rem) 0;
}

/* ----------------------------------------------------------------
   Split card
   ---------------------------------------------------------------- */
.auth-public-shell {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    width: 100%;
    max-width: 1020px;
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, .08));
    border-radius: 1.35rem;
    background-color: #fff;
    box-shadow: 0 1.75rem 4rem rgba(16, 24, 40, .10), 0 .25rem 1rem rgba(16, 24, 40, .05);
}

.auth-public-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 540px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    color: #fff;
    isolation: isolate;
}

.auth-public-visual > img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-public-visual::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(165deg, rgba(244, 117, 34, .10) 0%, rgba(13, 53, 80, .55) 48%, rgba(8, 40, 56, .93) 100%);
}

.auth-public-visual-body {
    max-width: 27rem;
}

.auth-public-visual .auth-badge {
    padding: .45rem .8rem;
    background-color: rgba(244, 117, 34, .92);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.auth-public-visual h2 {
    color: #fff;
    font-size: clamp(1.9rem, 3.4vw, 2.85rem);
    line-height: 1.02;
    letter-spacing: -.05em;
}

.auth-public-visual p {
    color: rgba(255, 255, 255, .84);
    font-size: .94rem;
    line-height: 1.6;
}

.auth-visual-points {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1.4rem;
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
}

.auth-visual-points i {
    margin-right: .45rem;
    color: #ffb36b;
}

/* ----------------------------------------------------------------
   Form panel
   ---------------------------------------------------------------- */
.auth-public-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(1.45rem, 3.2vw, 2.75rem);
}

.auth-kicker {
    padding: .42rem .72rem;
    border-radius: .55rem;
    background-color: var(--bs-tertiary-bg, #f6f7f8);
    color: var(--bs-heading-color, #111827);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.auth-public-card h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.auth-public-card .auth-subtitle {
    color: var(--bs-secondary-color, #6b7280);
    font-size: .9rem;
    line-height: 1.55;
}

.auth-lang {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background-color: var(--bs-tertiary-bg, #f6f7f8);
    font-size: .7rem;
    white-space: nowrap;
}

.auth-lang > i {
    margin: 0 .25rem 0 .35rem;
    color: var(--bs-secondary-color);
}

.auth-lang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .2rem .4rem;
    border-radius: 999px;
    color: var(--bs-secondary-color);
    font-weight: 700;
    text-decoration: none;
}

.auth-lang a:hover,
.auth-lang a.active {
    background-color: #fff;
    color: var(--bs-primary);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

.auth-form {
    margin-top: 1rem;
}

.auth-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
}

.auth-field-full {
    grid-column: 1 / -1;
}

.auth-public-card .form-label {
    margin-bottom: .35rem;
    color: var(--bs-body-color);
    font-size: .78rem;
    font-weight: 700;
}

.auth-public-card .form-label i {
    margin-right: .35rem;
    color: var(--bs-secondary-color);
}

.auth-public-card .form-control,
.auth-public-card .form-select {
    min-height: 44px;
    padding: .55rem .8rem;
    border-color: #dfe3e8;
    border-radius: .65rem;
    background-color: #fbfcfd;
    font-size: .9rem;
    box-shadow: none;
}

.auth-public-card .form-control:focus,
.auth-public-card .form-select:focus {
    border-color: var(--bs-primary);
    background-color: #fff;
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .14);
}

.auth-public-card .form-hint {
    display: block;
    margin-top: .3rem;
    color: var(--bs-secondary-color, #6b7280);
    font-size: .72rem;
    line-height: 1.4;
}

.auth-input-group .input-group-text {
    border-color: #dfe3e8;
    border-radius: .65rem 0 0 .65rem;
    background-color: #f3f5f7;
    color: var(--bs-secondary-color);
    font-size: .85rem;
}

.auth-input-group .form-control {
    border-radius: 0 .65rem .65rem 0;
}

.auth-public-card .btn-primary {
    min-height: 46px;
    border-radius: .65rem;
    font-weight: 700;
    box-shadow: 0 .6rem 1.2rem rgba(var(--bs-primary-rgb), .2);
}

.auth-public-card .btn-primary:hover {
    box-shadow: 0 .8rem 1.4rem rgba(var(--bs-primary-rgb), .26);
}

/* Password reveal control (admin.js toggles the fa-eye icons) */
.auth-public-card .password-field {
    position: relative;
}

.auth-public-card .password-field > .form-control {
    padding-right: 2.9rem;
}

.auth-public-card .password-toggle {
    position: absolute;
    top: 50%;
    right: .3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: .5rem;
    background-color: transparent;
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.auth-public-card .password-toggle:hover,
.auth-public-card .password-toggle:focus-visible {
    outline: none;
    background-color: var(--bs-tertiary-bg, #f3f4f6);
    color: var(--bs-body-color);
}

.auth-public-links {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, .08));
    font-size: .8rem;
}

.auth-link-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    color: var(--bs-secondary-color, #6b7280);
    font-weight: 500;
}

.auth-link-cta a {
    color: var(--bs-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-link-cta a:hover {
    color: var(--bs-primary-text-emphasis, #0a58ca);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    color: var(--bs-secondary-color, #6b7280);
}

.auth-link-meta a {
    color: var(--bs-secondary-color, #6b7280);
    font-weight: 600;
    text-decoration: none;
}

.auth-link-meta a:hover {
    color: var(--bs-primary);
}

.auth-link-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--bs-secondary-color, #6b7280);
    opacity: .55;
}

/* Password reset step indicator */
.auth-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .55rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--bs-secondary-color, #6b7280);
    font-size: .68rem;
    font-weight: 700;
}

.auth-steps li {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.auth-steps li:not(:last-child)::after {
    width: 1rem;
    height: 1px;
    margin-left: .1rem;
    content: "";
    background-color: var(--bs-border-color, #dee2e6);
}

.auth-steps .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 50%;
    background-color: var(--bs-tertiary-bg, #f6f7f8);
    font-size: .62rem;
}

.auth-steps li.active {
    color: var(--bs-primary);
}

.auth-steps li.active .num {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: #fff;
}

.auth-steps li.done .num {
    border-color: #198754;
    background-color: #198754;
    color: #fff;
}

/* OTP input */
.auth-otp-input {
    text-align: center;
    font-size: 1.15rem !important;
    font-weight: 800;
    letter-spacing: .42em;
}

.auth-inline-form {
    display: inline;
}

.auth-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--bs-secondary-color, #6b7280);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
}

.auth-link-button:hover:not(:disabled) {
    color: var(--bs-primary);
}

.auth-link-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.auth-public-card .alert {
    margin-bottom: .9rem;
    padding: .7rem 2.4rem .7rem .9rem;
    border-radius: .65rem;
    font-size: .82rem;
}

.auth-public-card .alert .alert-close {
    position: absolute;
    top: .35rem;
    right: .4rem;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 0;
    border-radius: .4rem;
    background-color: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    opacity: .65;
    cursor: pointer;
}

.auth-public-card .alert .alert-close:hover {
    background-color: rgba(17, 24, 39, .07);
    opacity: 1;
}

/* Honeypot – visually removed but still submitted */
.auth-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Registration form is slightly wider than the sign-in card */
.auth-public-shell--register {
    grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
    max-width: 1120px;
}

.auth-field-2 {
    grid-column: span 2;
}

.auth-form-actions {
    align-self: end;
}

/* ----------------------------------------------------------------
   Fit-to-viewport behaviour
   The header + auth card should fill the first viewport so the form
   is fully visible without scrolling. The full public footer follows
   below the fold.
   ---------------------------------------------------------------- */
.auth-public-main {
    min-height: calc(100svh - 72px);
}

@media (min-width: 992px) {
    .auth-public-main {
        min-height: calc(100svh - 72px);
        padding: clamp(.75rem, 2vh, 1.75rem) 0;
    }

    .auth-public-visual {
        min-height: 0;
        height: 100%;
    }

    .auth-public-shell {
        max-height: 100%;
    }

    .auth-public-shell--register .auth-form-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Short laptop screens: tighten spacing so nothing clips. */
@media (min-width: 992px) and (max-height: 760px) {
    .auth-public-card {
        padding: 1.25rem 2rem;
    }

    .auth-public-card h1 {
        font-size: 1.65rem;
    }

    .auth-public-card .auth-subtitle {
        margin-bottom: 1rem !important;
    }

    .auth-public-card .form-control,
    .auth-public-card .form-select,
    .auth-public-card .btn-primary {
        min-height: 40px;
    }

    .auth-form-row {
        gap: .55rem .9rem;
    }

    .auth-public-links {
        margin-top: .7rem;
        padding-top: .7rem;
    }

    .auth-public-visual h2 {
        font-size: 2rem;
    }

    .auth-visual-points {
        margin-top: 1rem;
    }
}

@media (min-width: 992px) and (max-height: 760px) {
    .auth-public-shell--register .auth-public-card {
        padding: .95rem 1.6rem;
    }

    .auth-public-shell--register .auth-form {
        margin-top: .65rem;
    }

    .auth-public-shell--register .auth-form-row {
        gap: .4rem .7rem;
    }

    .auth-public-shell--register .form-hint {
        display: none;
    }

    .auth-public-shell--register .auth-public-links {
        margin-top: .55rem;
        padding-top: .55rem;
    }
}

@media (max-width: 991.98px) {
    .auth-public-main {
        align-items: flex-start;
        padding: 1.25rem 0 2rem;
    }

    .auth-public-shell {
        display: block;
        border-radius: 1rem;
    }

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

    .auth-public-card {
        padding: clamp(1.35rem, 5vw, 2.25rem);
    }

    .auth-field-2,
    .auth-form-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }

    .auth-field-2,
    .auth-form-actions {
        grid-column: auto;
    }

    .auth-public-links {
        text-align: center;
    }
}
