:root {
    --auth-green: #1f5b48;
    --auth-green-dark: #153f33;
    --auth-green-soft: #edf6f2;
    --auth-ink: #17211d;
    --auth-muted: #6b7771;
    --auth-line: #dce5e0;
    --auth-bg: #f4f7f5;
    --auth-danger: #a53030;
    --auth-danger-bg: #fff0f0;
    --auth-success: #246447;
    --auth-success-bg: #edf8f1;
    --auth-info: #24516a;
    --auth-info-bg: #eef7fb;
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0
}

html {
    height: 100%
}

body.auth-body {
    min-height: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--auth-bg);
    color: var(--auth-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit
}

a {
    color: inherit
}

.auth-shell {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 44%) minmax(0, 56%);
    overflow: hidden;
}

.auth-visual {
    position: relative;
    min-width: 0;
    padding: clamp(36px, 5vw, 76px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.88)),
        url('../images/aircon.webp') center/cover no-repeat;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(4, 24, 18, .2) 35%, rgba(4, 24, 18, .75));
    pointer-events: none;
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 590px
}

.auth-home-link {
    position: absolute;
    z-index: 2;
    top: 32px;
    left: clamp(28px, 4vw, 64px);
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .01em;
}

.auth-home-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(10px);
    font-size: 18px;
}

.auth-eyebrow {
    margin: 0 0 13px;
    color: #d8ede4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.auth-visual h1 {
    margin: 0;
    max-width: 580px;
    font-size: clamp(38px, 4.4vw, 64px);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.auth-visual-copy {
    max-width: 560px;
    margin: 20px 0 0;
    color: #dbe8e2;
    font-size: 16px;
    line-height: 1.7;
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.auth-benefit {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #f4fbf8;
    font-size: 12px;
    font-weight: 750;
    backdrop-filter: blur(8px);
}

.auth-panel {
    min-width: 0;
    padding: 32px clamp(28px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f9fbfa, #f2f6f4);
}

.auth-card {
    width: min(100%, 520px);
    padding: clamp(28px, 3vw, 42px);
    border: 1px solid var(--auth-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(27, 67, 51, .10);
}

.auth-card.auth-card-wide {
    width: min(100%, 700px)
}

.auth-mobile-brand {
    display: none
}

.auth-card-header {
    margin-bottom: 24px
}

.auth-card-header h2 {
    margin: 0 0 8px;
    color: var(--auth-ink);
    font-size: clamp(27px, 2.4vw, 34px);
    line-height: 1.15;
    letter-spacing: -.025em;
}

.auth-card-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-card-header strong {
    color: var(--auth-ink)
}

.auth-form {
    display: grid;
    gap: 17px
}

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.auth-field {
    min-width: 0
}

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

.auth-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: #34423c;
    font-size: 13px;
    font-weight: 700;
}

.auth-required {
    color: #8a5c15;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em
}

.auth-input-wrap {
    position: relative
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cfdad4;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--auth-ink);
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-field input::placeholder {
    color: #9aa6a0
}

.auth-field input:focus {
    border-color: #5b8b78;
    box-shadow: 0 0 0 4px rgba(31, 91, 72, .09);
}

.auth-input-wrap input {
    padding-right: 72px
}

.auth-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-green);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.auth-toggle:hover {
    background: var(--auth-green-soft)
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-form-row.end {
    justify-content: flex-end
}

.auth-link {
    color: var(--auth-green);
    font-weight: 700;
    text-decoration: none
}

.auth-link:hover {
    text-decoration: underline
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #52605a;
    font-size: 12.5px;
    line-height: 1.5;
}

.auth-check input {
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--auth-green);
    flex: 0 0 auto
}

.auth-primary,
.auth-secondary {
    width: 100%;
    min-height: 48px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.auth-primary {
    border: 1px solid var(--auth-green);
    background: var(--auth-green);
    color: #fff;
    box-shadow: 0 9px 20px rgba(31, 91, 72, .18);
}

.auth-primary:hover {
    background: var(--auth-green-dark);
    transform: translateY(-1px)
}

.auth-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none
}

.auth-secondary {
    border: 1px solid #cfdad4;
    background: #fff;
    color: #34423c;
}

.auth-secondary:hover {
    background: #f5f8f6
}

.auth-divider {
    height: 1px;
    background: #edf1ef;
    margin: 4px 0
}

.auth-footnote {
    margin: 18px 0 0;
    color: var(--auth-muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert {
    margin-bottom: 17px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.auth-alert.error {
    border-color: #f0caca;
    background: var(--auth-danger-bg);
    color: var(--auth-danger)
}

.auth-alert.success {
    border-color: #cbe6d5;
    background: var(--auth-success-bg);
    color: var(--auth-success)
}

.auth-alert.info {
    border-color: #c9dfe9;
    background: var(--auth-info-bg);
    color: var(--auth-info)
}

.auth-otp {
    height: 62px !important;
    text-align: center;
    font-size: 25px !important;
    font-weight: 850;
    letter-spacing: .42em;
    padding-left: calc(14px + .42em) !important;
}

.auth-otp-hint {
    margin: -7px 0 0;
    color: #8a9690;
    font-size: 12px;
    text-align: center
}

/* Terms modal used by registration */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(10, 24, 19, .58);
    backdrop-filter: blur(4px);
}

.auth-modal.open {
    display: grid
}

.auth-modal-card {
    width: min(760px, 100%);
    max-height: min(82vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #dce5e0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .2);
}

.auth-modal-head {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #e7eeea;
}

.auth-modal-head h3 {
    margin: 0;
    font-size: 20px;
    color: var(--auth-ink)
}

.auth-modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f3;
    color: #4c5b54;
    cursor: pointer;
    font-size: 23px
}

.auth-modal-body {
    padding: 20px 22px;
    overflow: auto;
    color: #48564f;
    font-size: 13px;
    line-height: 1.65
}

.auth-modal-body h4 {
    margin: 20px 0 6px;
    color: #1d2d26;
    font-size: 14px
}

.auth-modal-body h4:first-child {
    margin-top: 0
}

.auth-modal-body ul {
    margin: 7px 0 0;
    padding-left: 20px
}

.auth-modal-foot {
    padding: 16px 22px;
    border-top: 1px solid #e7eeea;
    background: #fafcfb
}

.auth-modal-foot .auth-primary {
    max-width: 190px;
    float: right
}

/* Keep the old loader compatible if it is still present elsewhere. */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    background: #f4f7f5;
    transition: opacity .3s ease, visibility .3s ease
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden
}

.loader-box {
    width: min(360px, 86vw)
}

.loader-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px
}

.loader-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--auth-green);
    color: #fff;
    font-size: 21px;
    font-weight: 900
}

.loader-text h2,
.loader-text p {
    margin: 0;
    color: var(--auth-ink)
}

.loader-text h2 {
    font-size: 22px
}

.loader-text p {
    font-size: 14px;
    color: var(--auth-muted)
}

.loader-bar {
    height: 5px;
    border-radius: 999px;
    background: #dce5e0;
    overflow: hidden
}

.loader-progress {
    height: 100%;
    background: var(--auth-green);
    animation: authLoad .65s ease forwards
}

@keyframes authLoad {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@media(max-width:900px) {
    body.auth-body {
        height: auto;
        min-height: 100vh;
        overflow: auto
    }

    .auth-shell {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        overflow: visible
    }

    .auth-visual {
        display: none
    }

    .auth-panel {
        min-height: 100vh;
        padding: 28px 18px
    }

    .auth-card,
    .auth-card.auth-card-wide {
        width: min(100%, 640px);
        padding: 28px
    }

    .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 24px;
        color: var(--auth-green);
        font-weight: 900;
        text-decoration: none
    }

    .auth-mobile-brand .auth-home-mark {
        width: 38px;
        height: 38px;
        background: var(--auth-green);
        border-color: var(--auth-green);
        color: #fff
    }
}

@media(max-width:620px) {
    .auth-panel {
        align-items: flex-start;
        padding: 18px 12px
    }

    .auth-card,
    .auth-card.auth-card-wide {
        padding: 24px 18px;
        border-radius: 16px
    }

    .auth-form-grid {
        grid-template-columns: 1fr
    }

    .auth-field-full {
        grid-column: auto
    }

    .auth-card-header {
        margin-bottom: 20px
    }

    .auth-form-row {
        align-items: flex-start;
        flex-direction: column
    }

    .auth-form-row.end {
        align-items: flex-end
    }

    .auth-modal {
        padding: 10px
    }

    .auth-modal-card {
        max-height: 92vh;
        border-radius: 15px
    }
}

@media(max-height:720px) and (min-width:901px) {
    body.auth-body {
        height: auto;
        min-height: 100vh;
        overflow: auto
    }

    .auth-shell {
        height: auto;
        min-height: 100vh
    }

    .auth-panel {
        padding-top: 24px;
        padding-bottom: 24px
    }

    .auth-card {
        padding: 26px 32px
    }

    .auth-card-header {
        margin-bottom: 18px
    }

    .auth-form {
        gap: 13px
    }

    .auth-field input {
        height: 44px
    }

    .auth-primary,
    .auth-secondary {
        min-height: 44px
    }
}