/* Shared auth / admin login page styles */
:root {
    --login-teal: #16c2a3;
    --login-teal-light: #2dd4bf;
    --login-blue: #0055ff;
    --login-dark: #000812;
    --login-panel: rgba(0, 18, 32, 0.97);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-login-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

.login-page-wrap {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.login-panel-wrap {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    background:
        linear-gradient(180deg, rgba(0, 28, 45, 0.98) 0%, rgba(0, 12, 24, 0.99) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(22, 194, 163, 0.2);
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 2;
}

/* Client auth pages — 50/50 split, form scrolls, image fixed */
body.client-login-page .login-page-wrap {
    height: 100vh;
    overflow: hidden;
}

body.client-login-page .login-panel-wrap {
    width: 50%;
    max-width: 50%;
    flex: 0 0 50%;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 32px 48px 48px;
    background:
        linear-gradient(180deg, rgba(0, 18, 32, 0.98) 0%, rgba(0, 8, 18, 0.99) 100%);
    -webkit-overflow-scrolling: touch;
}

body.client-login-page .login-card {
    width: 100%;
    max-width: 520px;
    margin: auto;
    flex-shrink: 0;
}

body.client-login-page .login-hero {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    flex: none;
    padding: 0;
    z-index: 1;
}

body.client-login-page .login-hero-content {
    display: none;
}

/* reCAPTCHA — pinned to bottom-right of image panel (right half) */
body.client-login-page .login-hero {
    overflow: visible;
}

body.client-login-page .login-hero .grecaptcha-badge {
    position: absolute !important;
    bottom: 16px !important;
    right: -186px !important;
    left: auto !important;
    z-index: 9999 !important;
}

body.client-login-page .login-hero .grecaptcha-badge:hover {
    right: 16px !important;
}

.login-panel-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--login-blue) 0%, var(--login-teal) 50%, var(--login-blue) 100%);
}

.login-hero {
    flex: 1;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* Client hero keeps overflow visible for reCAPTCHA tab (set above) */

/* Client login — clear full-bleed image on right half */
body.client-login-page .login-hero {
    background-color: #0a2a45;
    padding: 0;
}

body.client-login-page .login-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transform: scale(1);
}

body.client-login-page .login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, transparent 70%, rgba(0, 12, 24, 0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Admin login — full illustration visible */
body.admin-login-page .login-hero {
    background-color: #000812;
    padding: 32px 48px;
}

body.admin-login-page .login-hero-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: calc(100vh - 64px);
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.4));
}

body.admin-login-page .login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 50%, rgba(0, 8, 18, 0.4) 100%),
        linear-gradient(to right, rgba(0, 8, 18, 0.6) 0%, transparent 15%);
    pointer-events: none;
    z-index: 0;
}

.login-hero-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    text-align: center;
    padding: 32px;
}

.login-hero-badge {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(22, 194, 163, 0.15);
    border: 1px solid rgba(22, 194, 163, 0.35);
    color: var(--login-teal-light);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.login-hero-title {
    color: #ffffff;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.login-hero-title span {
    background: linear-gradient(135deg, #4d9fff 0%, var(--login-teal-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-hero-text {
    color: rgba(255, 255, 255, 0.72);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.login-hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.login-hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(22, 194, 163, 0.2);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
}

.login-hero-feature::before {
    content: '✓';
    color: var(--login-teal);
    font-weight: 700;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.logo-brand {
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf9 100%);
    border-radius: 18px;
    padding: 24px 32px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(22, 194, 163, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.logo-brand img {
    display: inline-block;
    height: 68px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.Logo_heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.Logo_heading h1,
.heading_logo h1 {
    color: #ffffff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.account-type {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 22px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 14px;
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--login-teal);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked {
    background: var(--login-teal);
    box-shadow: inset 0 0 0 3px rgba(0, 18, 32, 0.9);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.button_checkbox {
    margin-top: 8px;
}

.register_message {
    margin-bottom: 16px;
}

.logo-brand--compact {
    flex: 1;
    margin-bottom: 0;
    padding: 14px 18px;
    border-radius: 14px;
}

.logo-brand--compact img {
    height: 52px;
}

.login-page-title--inline {
    margin-bottom: 0;
    text-align: right;
    font-size: 28px;
    letter-spacing: 3px;
    white-space: nowrap;
}

.login-welcome {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    margin-bottom: 28px;
    font-weight: 400;
}

/* Avora-style white inputs on client login */
body.client-login-page input[type="text"],
body.client-login-page input[type="email"],
body.client-login-page input[type="tel"],
body.client-login-page input[type="password"],
body.client-login-page select {
    background: #ffffff;
    border: 1px solid rgba(22, 194, 163, 0.25);
    color: #0a1628;
    border-radius: 8px;
    padding: 14px 16px;
}

body.client-login-page input::placeholder {
    color: rgba(10, 22, 40, 0.4);
}

body.client-login-page input:focus {
    border-color: var(--login-teal);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 194, 163, 0.2);
}

body.client-login-page .toggle-password {
    color: rgba(10, 22, 40, 0.45);
}

body.client-login-page .btn-signup {
    background: linear-gradient(135deg, var(--login-blue) 0%, var(--login-teal) 100%);
    color: #ffffff;
    border-radius: 8px;
    letter-spacing: 1.5px;
    margin-top: 16px;
}

.login-page-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 5px;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-page-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

.login-flash-success {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-flash-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.auth-login-page input[type="text"],
.auth-login-page input[type="email"],
.auth-login-page input[type="tel"],
.auth-login-page input[type="password"],
.auth-login-page select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(22, 194, 163, 0.28);
    border-radius: 12px;
    padding: 15px 16px;
    color: #ffffff;
    font-size: 15px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-login-page input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-login-page input:focus,
.auth-login-page select:focus {
    outline: none;
    border-color: var(--login-teal);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 4px rgba(22, 194, 163, 0.15);
}

.btn-signup {
    width: 100%;
    background: linear-gradient(135deg, var(--login-blue) 0%, var(--login-teal) 100%);
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 85, 255, 0.3);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(22, 194, 163, 0.4);
}

.checkbox_login {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox_login .text-info,
.signin-link a {
    color: var(--login-teal-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.checkbox_login .text-info:hover,
.signin-link a:hover {
    color: #ffffff;
}

.signin-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 13px;
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--login-teal);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.checkbox-option input[type="checkbox"]:checked {
    background: var(--login-teal);
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 13px;
    top: -2px;
    left: 2px;
}

.form-group.has-eye {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 14px;
    bottom: 15px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    user-select: none;
}

.password-group {
    position: relative;
}

.password-group .toggle-password {
    top: 44px;
    bottom: auto;
}

.text-danger {
    color: #f87171;
    font-size: 13px;
}

@media (max-width: 900px) {
    body.auth-login-page,
    body.client-login-page {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        min-height: 100dvh;
        width: 100%;
    }

    .login-page-wrap {
        flex-direction: column;
        height: auto !important;
        min-height: 100dvh;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    body.client-login-page .login-page-wrap {
        display: block !important;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    /* Mobile: form-only layout — hide side image strip */
    body.client-login-page .login-hero {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    body.client-login-page .login-panel-wrap {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: auto !important;
        min-height: 100dvh;
        max-height: none !important;
        overflow-y: auto;
        overflow-x: hidden;
        padding:
            max(20px, env(safe-area-inset-top))
            max(18px, env(safe-area-inset-right))
            max(72px, calc(56px + env(safe-area-inset-bottom)))
            max(18px, env(safe-area-inset-left));
        background:
            linear-gradient(165deg, rgba(0, 18, 32, 0.97) 0%, rgba(0, 32, 52, 0.95) 100%),
            url("/images/client-login-bg.png?v=3") center center / cover no-repeat;
        border-right: none;
        box-shadow: none;
    }

    body.client-login-page .login-panel-wrap::before {
        display: none;
    }

    body.client-login-page .login-card {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .Logo_heading {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 20px;
    }

    .logo-brand--compact {
        text-align: center;
        padding: 16px 20px;
    }

    .logo-brand--compact img {
        height: 48px;
    }

    .login-page-title--inline {
        text-align: center;
        white-space: normal;
        font-size: 24px;
        letter-spacing: 2px;
        line-height: 1.2;
    }

    .login-welcome {
        text-align: center;
        margin-bottom: 22px;
    }

    .checkbox_login {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    body.client-login-page input[type="text"],
    body.client-login-page input[type="email"],
    body.client-login-page input[type="tel"],
    body.client-login-page input[type="password"],
    body.client-login-page select,
    .auth-login-page input[type="text"],
    .auth-login-page input[type="email"],
    .auth-login-page input[type="tel"],
    .auth-login-page input[type="password"],
    .auth-login-page select {
        font-size: 16px;
        padding: 14px 15px;
    }

    .btn-signup {
        padding: 15px 16px;
        font-size: 15px;
        letter-spacing: 1.5px;
    }

    body.client-login-page .grecaptcha-badge {
        position: fixed !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        right: -186px !important;
        left: auto !important;
    }

    body.client-login-page .grecaptcha-badge:hover {
        right: max(12px, env(safe-area-inset-right)) !important;
    }

    body.admin-login-page .login-hero {
        display: none;
    }

    body.admin-login-page .login-panel-wrap {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        border-right: none;
        min-height: 100dvh;
        padding: 32px 24px;
        background: linear-gradient(160deg, #000812 0%, #001520 50%, #002d3f 100%);
    }
}

@media (max-width: 480px) {
    body.client-login-page .login-panel-wrap {
        padding:
            max(16px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(68px, calc(52px + env(safe-area-inset-bottom)))
            max(14px, env(safe-area-inset-left));
    }

    .login-page-title--inline {
        font-size: 20px;
        letter-spacing: 1.5px;
    }

    .logo-brand--compact img {
        height: 42px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .account-type {
        flex-direction: column;
        gap: 12px;
    }

    .checkbox-option {
        font-size: 14px;
        line-height: 1.4;
    }

    .signin-link {
        font-size: 13px;
        line-height: 1.5;
    }

    .login-page-title {
        font-size: 17px;
        letter-spacing: 2px;
    }
}

@media (max-width: 360px) {
    .login-page-title--inline {
        font-size: 18px;
    }

    .checkbox_login .text-info {
        font-size: 12px;
    }
}
