/**
 * PE Auth Popup — standalone CSS for the auth modal overlay.
 * Loaded globally on all pages for non-logged-in users.
 */

:root {
    --pe-blue: #2195F2;
    --pe-yellow: #F8C220;
    --pe-dark: #0A0A0A;
    --pe-red: #F33939;
    --pe-green: #16a34a;
    --pe-radius: 8px;
    --pe-radius-pill: 50px;
    --pe-font: 'Montserrat', sans-serif;
}

/* ── Popup container ── */
.pe-auth-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pe-auth-popup .pe-auth__overlay {
    position: fixed;
    inset: 0;
    background: rgba(16,20,23,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
    cursor: pointer;
}

/* ── Close button ── */
.pe-auth-popup .pe-auth__close {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 1px solid #EAF3FB;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
}
.pe-auth-popup .pe-auth__close:hover {
    opacity: 0.7;
}

/* ── Panel ── */
.pe-auth__panel {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

/* ── Wrapper ── */
.pe-auth-popup .pe-auth__wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 420px;
}

/* ── Header ── */
.pe-auth-popup .pe-auth__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.pe-auth-popup .pe-auth__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.pe-auth-popup .pe-auth__logo-arrows {
    font-size: 32px;
    font-weight: 900;
    color: var(--pe-blue);
    line-height: 1;
    font-family: var(--pe-font);
    margin-right: 4px;
}
.pe-auth-popup .pe-auth__logo-portal {
    font-size: 36px;
    font-weight: 800;
    color: var(--pe-blue);
    line-height: 1.1;
    font-family: var(--pe-font);
}
.pe-auth-popup .pe-auth__logo-express {
    font-size: 36px;
    font-weight: 800;
    color: var(--pe-yellow);
    line-height: 1.1;
    font-family: var(--pe-font);
}

/* ── Language ── */
.pe-auth-popup .pe-auth__lang {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.pe-auth-popup .pe-auth__lang-item {
    font-size: 16px;
    font-weight: 300;
    text-decoration: none;
    color: #BCCCDF;
    line-height: 19px;
}
.pe-auth-popup .pe-auth__lang-item--active {
    font-weight: 700;
    color: var(--pe-blue);
}

/* ── Divider ── */
.pe-auth-popup .pe-auth__divider {
    width: 100%;
    height: 1px;
    background: #DBE5F2;
}

/* ── Title ── */
.pe-auth-popup .pe-auth__title {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    text-align: center;
}

/* ── Messages ── */
.pe-auth-popup .pe-auth__message {
    padding: 10px 14px;
    border-radius: var(--pe-radius);
    font-size: 13px;
    width: 100%;
}
.pe-auth-popup .pe-auth__message--error {
    background: #fef2f2;
    color: var(--pe-red);
    border: 1px solid #fecaca;
}
.pe-auth-popup .pe-auth__message--success {
    background: #f0fdf4;
    color: var(--pe-green);
    border: 1px solid #bbf7d0;
}

/* ── Card ── */
.pe-auth-popup .pe-auth__card {
    width: 100%;
    background: #EBF6FF;
    border: 1px solid #DBE5F2;
    border-radius: 16px;
    padding: 35px 22px;
}
.pe-auth-popup .pe-auth__card-divider {
    width: 100%;
    height: 1px;
    background: #DBE5F2;
    margin: 18px 0;
}

/* ── Form ── */
.pe-auth-popup .pe-auth__form {
    text-align: left;
}
.pe-auth-popup .pe-form__group {
    margin-bottom: 16px;
}
.pe-auth-popup .pe-form__group label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #0A0A0A;
    margin-bottom: 6px;
}
.pe-auth-popup .pe-form__group input,
.pe-auth-popup .pe-form__group select {
    display: block;
    width: 100%;
    height: 48px;
    padding: 14px;
    font-size: 16px;
    font-weight: 300;
    border: 1px solid #DBE5F2;
    border-radius: 4px;
    background: #FFF;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--pe-font);
    text-transform: none !important;
}
.pe-auth-popup .pe-form__group input:focus {
    border-color: var(--pe-blue);
}
.pe-auth-popup .pe-form__group input::placeholder {
    color: #BCCCDF;
    font-weight: 300;
    text-transform: none !important;
}
.pe-auth-popup .pe-required {
    color: #F33939;
    font-size: 20px;
    vertical-align: top;
    line-height: 1;
}

/* ── Password toggle ── */
.pe-auth-popup .pe-input-password {
    position: relative;
}
.pe-auth-popup .pe-input-password input {
    padding-right: 48px;
}
.pe-auth-popup .pe-input-password__toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.4;
}
.pe-auth-popup .pe-input-password__toggle svg path {
    fill: #BCCCDF !important;
}

/* ── Phone field ── */
.pe-auth-popup .pe-prof__phone-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pe-auth-popup .pe-prof__phone-flag {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}
.pe-auth-popup .pe-prof__phone-wrap input {
    padding-left: 40px !important;
}

/* ── Checkbox ── */
.pe-auth-popup .pe-checkbox {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    line-height: 1;
    margin: 0 auto;
    width: auto;
}
.pe-auth-popup .pe-checkbox span {
    font-size: 14px;
    color: #424242;
    line-height: 1;
    display: inline-block !important;
}
.pe-auth-popup .pe-checkbox input[type="checkbox"] {
    all: unset;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    border: 1px solid #BCCCDF !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    margin: 0 !important;
    background: #FFF !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}
.pe-auth-popup .pe-checkbox input[type="checkbox"]:checked {
    background: var(--pe-yellow) !important;
    border-color: var(--pe-yellow) !important;
}
body .pe-auth-popup .pe-checkbox input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    width: 10px !important;
    height: 8px !important;
    margin: auto !important;
    background: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center !important;
    background-size: contain !important;
    display: block !important;
    border: none !important;
    transform: none !important;
    opacity: 1 !important;
}

/* ── Buttons ── */
.pe-auth-popup .pe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    border-radius: var(--pe-radius-pill);
    font-family: var(--pe-font);
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s;
    text-decoration: none;
}
.pe-auth-popup .pe-btn--full {
    width: 100%;
}
body .pe-auth-popup .pe-btn--primary {
    height: 48px;
    padding: 0 24px;
    background: var(--pe-blue) !important;
    color: #FFF !important;
    box-shadow: 0 2px 4px 0 rgba(100,179,242,0.28);
    border: none !important;
}
body .pe-auth-popup .pe-btn--primary:hover {
    background: #1a7fd8 !important;
}
.pe-auth-popup .pe-btn--google {
    height: 48px;
    padding: 0 24px;
    background: transparent;
    border: 1px solid var(--pe-blue);
    color: var(--pe-blue);
    gap: 8px;
}
.pe-auth-popup .pe-btn--google:hover {
    background: rgba(33,149,242,0.06);
}

/* Google GSI rendered button container */
.pe-auth-popup .pe-google-signin-btn,
.pe-auth__wrapper .pe-google-signin-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    margin-top: 4px;
}
.pe-auth-popup .pe-google-signin-btn > div,
.pe-auth__wrapper .pe-google-signin-btn > div {
    width: 100% !important;
    max-width: 340px;
}
.pe-auth-popup .pe-btn--outline {
    background: transparent !important;
    border: 1px solid var(--pe-blue) !important;
    color: var(--pe-blue) !important;
    border-radius: var(--pe-radius-pill);
    padding: 12px 24px !important;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pe-auth-popup .pe-btn--outline:hover {
    background: rgba(33,149,242,0.08) !important;
}

/* ── Links ── */
.pe-auth-popup .pe-auth__links {
    text-align: center;
    margin: 14px 0 0;
}
.pe-auth-popup .pe-auth__link {
    font-size: 14px;
    color: var(--pe-blue);
    text-decoration: none;
}
.pe-auth-popup .pe-auth__link:hover {
    text-decoration: underline;
}
.pe-auth-popup .pe-auth__footer {
    text-align: center;
    font-size: 14px;
    color: #8D9FB3;
    margin: 14px 0 0;
}
.pe-auth-popup .pe-auth__footer a {
    color: var(--pe-blue);
    text-decoration: none;
}
.pe-auth-popup .pe-auth__footer a:hover {
    text-decoration: underline;
}

/* ── Separator ── */
.pe-auth-popup .pe-auth__separator {
    display: flex;
    align-items: center;
    margin: 14px 0;
    font-size: 16px;
    color: #424242;
}
.pe-auth-popup .pe-auth__separator::before,
.pe-auth-popup .pe-auth__separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #DBE5F2;
}
.pe-auth-popup .pe-auth__separator::before { margin-right: 12px; }
.pe-auth-popup .pe-auth__separator::after { margin-left: 12px; }

/* ── Forgot password extras ── */
.pe-auth-popup .pe-auth__icon-lock {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.pe-auth-popup .pe-auth__step-label {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #8D9FB3;
    margin: 4px 0 0;
}
.pe-auth-popup .pe-auth__hint {
    font-size: 16px;
    font-weight: 300;
    line-height: 19px;
    color: #424242;
    text-align: center;
    margin: 12px 0 0;
}
.pe-auth-popup .pe-auth__resend {
    text-align: center;
}
.pe-auth-popup .pe-auth__resend-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--pe-dark);
    margin: 0 0 12px;
}

/* ── Inline group ── */
.pe-auth-popup .pe-form__group--inline {
    display: flex;
    align-items: center;
}
.pe-auth-popup .pe-form__group--checkbox {
    margin-top: 16px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .pe-auth-popup .pe-auth__wrapper {
        max-width: 100%;
    }
    .pe-auth-popup .pe-auth__close {
        top: 16px;
        right: 16px;
    }
    .pe-auth-popup .pe-auth__card {
        padding: 24px 16px;
    }
    .pe-auth-popup .pe-auth__title {
        font-size: 20px;
        text-transform: none;
    }
    .pe-auth__panel {
        padding: 20px 12px;
    }
}
