/* Auth card design system — Login / Register / Forgot share one geometry. */

:root {
    --pkr-auth-card-w: min(404px, calc(100vw - 36px));
    --pkr-auth-inner-pad-x: 38px;
    --pkr-auth-inner-pad-top: 36px;
    --pkr-auth-inner-pad-bottom: 34px;
    --pkr-auth-gap-brand-title: 14px;
    --pkr-auth-gap-title-body: 21px;
    --pkr-auth-gap-field: 17px;
    --pkr-auth-gap-label: 7px;
    --pkr-auth-gap-action: 17px;
    --pkr-auth-gap-forgot: 26px;
    --pkr-auth-gap-divider: 23px;
    --pkr-auth-logo-w: clamp(121px, 34vw, 162px);
    --pkr-auth-input-h: 50px;
    --pkr-auth-icon-slot: 40px;
    --pkr-auth-icon-size: 16px;
    --pkr-auth-primary-h: 50px;
    --pkr-auth-input-radius: 10px;
    /* Morph keyframes read these (surface has no padding). */
    --pkr-auth-surface-pad-x: 0px;
    --pkr-auth-surface-pad-y: 0px;
}

.login.pkr-auth-shell {
    max-width: var(--pkr-auth-card-w);
    width: var(--pkr-auth-card-w);
}

.pkr-auth-card {
    max-width: var(--pkr-auth-card-w);
    width: var(--pkr-auth-card-w);
}

.pkr-auth-card__surface {
    padding: 0;
}

/* Inner content column — inputs/buttons are 100% of THIS, not outer card. */
.pkr-auth-inner {
    box-sizing: border-box;
    padding:
        var(--pkr-auth-inner-pad-top)
        var(--pkr-auth-inner-pad-x)
        var(--pkr-auth-inner-pad-bottom);
    position: relative;
    z-index: 2;
}

/* ── Shell ── */
.pkr-auth-pane {
    inset: 0;
    position: absolute;
}

.pkr-auth-pane__frame {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 2;
}

.pkr-auth-pane__decor {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.pkr-auth-pane__brand {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    margin: 0 auto var(--pkr-auth-gap-brand-title);
    width: var(--pkr-auth-logo-w);
}

.pkr-auth-pane__brand img {
    aspect-ratio: 480 / 177;
    display: block;
    height: auto;
    object-fit: contain;
    width: 100%;
}

.pkr-auth-pane__head {
    flex: 0 0 auto;
    margin: 0 0 var(--pkr-auth-gap-title-body);
}

.pkr-auth-pane__title {
    color: rgba(233, 190, 120, 0.95);
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
    text-align: center;
}

.pkr-auth-pane__body {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
}

.pkr-auth-pane__foot {
    flex: 0 0 auto;
    margin-top: var(--pkr-auth-gap-action);
    text-align: center;
}

.pkr-auth-pane--login .pkr-auth-pane__foot,
.pkr-auth-pane--register .pkr-auth-pane__foot,
.pkr-auth-pane--forgot .pkr-auth-pane__foot {
    margin-top: var(--pkr-auth-gap-forgot);
}

.pkr-auth-pane__foot > .pkr-auth-divider:first-child {
    margin-top: 0;
}

.pkr-auth-desc,
.pkr-auth-forgot-intro {
    color: rgba(215, 187, 156, 0.82);
    font-size: 11px;
    line-height: 1.65;
    margin: 0 0 var(--pkr-auth-gap-title-body);
    text-align: center;
}

/* ── Form ── */
.login.pkr-auth-shell .formrow {
    margin: 0 0 var(--pkr-auth-gap-field);
}

.login.pkr-auth-shell .formrow:last-child {
    margin-bottom: 0;
}

.pkr-auth-field {
    margin: 0;
}

.pkr-auth-field__label {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.pkr-auth-field__caption {
    color: rgba(215, 187, 156, 0.88);
    display: block;
    font-size: 11px;
    line-height: 1.45;
    margin: 0 0 var(--pkr-auth-gap-label);
    text-align: right;
}

.pkr-auth-input-shell {
    display: block;
    position: relative;
}

.pkr-auth-input-shell .pkr-auth-input {
    background: linear-gradient(180deg, rgba(16, 13, 15, 0.78) 0%, rgba(7, 6, 8, 0.86) 100%);
    border: 1px solid rgba(196, 168, 132, 0.16);
    border-radius: var(--pkr-auth-input-radius);
    box-shadow: inset 0 1px 0 rgba(233, 190, 120, 0.06), inset 0 -10px 16px rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
    color: var(--text-primary);
    float: none;
    font-size: clamp(13px, 1.5vw, 14px);
    height: var(--pkr-auth-input-h);
    min-height: var(--pkr-auth-input-h);
    margin: 0;
    padding-inline-end: 12px;
    padding-inline-start: var(--pkr-auth-icon-slot);
    text-align: right;
    transition: border-color 300ms ease, background-color 300ms ease, box-shadow 300ms ease;
    width: 100%;
}

.pkr-auth-input-shell--plain .pkr-auth-input {
    padding-inline-start: 14px;
}

.pkr-auth-input-shell .pkr-auth-input.ltr-field {
    direction: ltr;
    text-align: left;
}

.pkr-auth-input-shell--pass .pkr-auth-input {
    padding-inline-end: var(--pkr-auth-icon-slot);
}

.pkr-auth-input-shell .pkr-auth-input::placeholder {
    color: rgba(164, 141, 128, 0.75);
    opacity: 1;
}

.pkr-auth-input-shell .pkr-auth-input:hover {
    border-color: rgba(233, 190, 120, 0.28);
}

.pkr-auth-input-shell .pkr-auth-input:focus {
    background: linear-gradient(180deg, rgba(18, 14, 16, 0.9) 0%, rgba(8, 6, 8, 0.94) 100%);
    border-color: rgba(233, 190, 120, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(233, 190, 120, 0.08),
        0 0 0 1px rgba(233, 190, 120, 0.14),
        0 0 10px rgba(233, 190, 120, 0.08);
    outline: none;
}

.pkr-auth-input-shell:focus-within .pkr-auth-field__icon,
.pkr-auth-input-shell:focus-within .pkr-auth-field__toggle {
    color: rgba(244, 228, 190, 0.96);
}

.pkr-auth-field__icon {
    align-items: center;
    color: rgba(255, 255, 255, 0.38);
    transition: color 300ms ease;
    display: flex;
    height: var(--pkr-auth-icon-size);
    inset-inline-start: 10px;
    justify-content: center;
    opacity: 0.92;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    z-index: 1;
}

.pkr-auth-field__icon svg {
    display: block;
    height: var(--pkr-auth-icon-size);
    width: var(--pkr-auth-icon-size);
}

.pkr-auth-eye--off {
    display: none;
}

.pkr-auth-field__toggle[aria-pressed="true"] .pkr-auth-eye--on {
    display: none;
}

.pkr-auth-field__toggle[aria-pressed="true"] .pkr-auth-eye--off {
    display: block;
}

.pkr-auth-field__toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.4);
    transition: color 300ms ease;
    cursor: pointer;
    display: flex;
    height: var(--pkr-auth-icon-size);
    inset-inline-end: 9px;
    justify-content: center;
    opacity: 0.92;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    z-index: 1;
}

.pkr-auth-field__toggle svg {
    display: block;
    height: 14px;
    width: 14px;
}

.pkr-auth-field:has(.pkr-auth-password-hint) .pkr-auth-input::placeholder {
    color: transparent;
}

.login.pkr-auth-shell .pkr-auth-password-hint {
    color: rgba(164, 141, 128, 0.82);
    direction: rtl;
    display: block;
    font-size: 10px;
    line-height: 1.45;
    margin: 6px 0 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    position: static;
    text-align: right;
    white-space: normal;
}

/* ── Primary button (shared) ── */
.login.pkr-auth-shell .pkr-auth-btnrow {
    margin: var(--pkr-auth-gap-action) 0 0;
}

.login.pkr-auth-shell a.loginbtn.pkr-auth-primary {
    align-items: center;
    background: linear-gradient(180deg, rgba(20, 16, 18, 0.98) 0%, rgba(8, 7, 9, 0.99) 58%, rgba(16, 11, 12, 0.98) 100%);
    border: 1px solid rgba(212, 168, 98, 0.46);
    border-radius: var(--pkr-auth-input-radius);
    box-shadow:
        inset 0 1px 0 rgba(233, 190, 120, 0.16),
        inset 0 -12px 18px rgba(0, 0, 0, 0.42),
        0 10px 22px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    color: rgba(244, 234, 233, 0.96);
    cursor: pointer;
    display: flex;
    font-size: clamp(14px, 1.7vw, 15px);
    font-weight: 700;
    height: auto;
    justify-content: center;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
    min-height: var(--pkr-auth-primary-h);
    padding: 0 42px;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
    width: 100%;
}

.login.pkr-auth-shell a.loginbtn.pkr-auth-primary:hover,
.login.pkr-auth-shell a.loginbtn.pkr-auth-primary:focus-visible {
    border-color: rgba(233, 190, 120, 0.58);
    box-shadow:
        inset 0 1px 0 rgba(233, 190, 120, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.42);
    color: rgba(255, 248, 240, 0.98);
    outline: none;
}

.login.pkr-auth-shell a.loginbtn.pkr-auth-primary:active {
    transform: translateY(1px);
}

#getlogin::before {
    background: radial-gradient(85% 140% at 50% 50%, rgba(233, 190, 120, 0.22) 0%, rgba(112, 62, 150, 0.07) 50%, transparent 74%);
    border-radius: inherit;
    box-shadow:
        inset 0 0 12px rgba(233, 190, 120, 0.18),
        0 0 14px rgba(233, 190, 120, 0.2),
        0 0 16px rgba(104, 58, 148, 0.1);
    content: "";
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

#getlogin.is-login-halo::before {
    animation: pkr-login-halo 340ms ease-out;
}

@keyframes pkr-login-halo {
    0% { opacity: 0; }
    22% { opacity: 1; }
    100% { opacity: 0; }
}

.pkr-auth-primary__label {
    position: relative;
    z-index: 1;
}

.pkr-auth-primary__arrow {
    align-items: center;
    border: 1px solid rgba(212, 168, 98, 0.34);
    border-radius: 50%;
    color: rgba(233, 190, 120, 0.92);
    display: inline-flex;
    height: 25px;
    inset-inline-start: 12px;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    z-index: 2;
}

.pkr-auth-primary__arrow svg {
    display: block;
    height: 12px;
    width: 12px;
}

/* ── Secondary actions ── */
.pkr-auth-link {
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    color: rgba(233, 190, 120, 0.9) !important;
    cursor: pointer;
    display: inline-block;
    font-size: 11px !important;
    font-weight: 600;
    height: auto !important;
    line-height: 1.5;
    margin: 0;
    min-height: 0 !important;
    padding: 4px 2px !important;
    text-decoration: none;
    width: auto !important;
}

.pkr-auth-link:hover {
    color: var(--gold-bright) !important;
    opacity: 1;
    text-decoration: underline;
}

.pkr-auth-switch-row {
    margin: 0 !important;
}

.pkr-auth-switch-row .pkr-auth-link {
    font-size: 12px !important;
}

.pkr-auth-pane__foot .pkr-auth-link.forgetpass {
    display: inline-block;
    margin-top: 0;
    padding: 0 4px !important;
}

.pkr-auth-divider {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: var(--pkr-auth-gap-divider);
    padding-bottom: 4px;
}

.pkr-auth-divider__line {
    background: linear-gradient(90deg, transparent, rgba(212, 168, 98, 0.18), transparent);
    flex: 1 1 0;
    height: 1px;
    max-width: 84px;
}

.pkr-auth-divider .pkr-auth-link {
    font-size: 12px !important;
    white-space: nowrap;
}

/* ── Notes / loaders ── */
.login.pkr-auth-shell span.note {
    margin-top: 10px;
}

.pkr-auth-form-note:empty {
    display: none;
}

.login.pkr-auth-shell .forgetform {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    margin: 0;
    min-height: 0;
    padding: 0;
    position: static;
    width: 100%;
}

.login.pkr-auth-shell .forgetform .loader {
    left: auto;
    margin: 8px auto 0;
    position: static;
    top: auto;
}

.pkr-auth-pane--forgot:has(.forget-sent:not([hidden])) .pkr-auth-forgot-intro {
    display: none;
}

.pkr-auth-pane--register .reg-step[data-reg-step="code"] > .pkr-auth-subtitle {
    display: none;
}

.pkr-auth-forgot-sent-actions[hidden],
.pkr-auth-forgot-actions[hidden],
.pkr-auth-forgot-submit[hidden] {
    display: none !important;
}

/* ── Decorations ── */
.pkr-auth-pane-watermark {
    color: rgba(255, 255, 255, 0.028);
    font-family: "Lato", "Segoe UI Symbol", serif;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    user-select: none;
}

.pkr-auth-pane-watermark--tr {
    font-size: clamp(72px, 12vw, 108px);
    inset-inline-end: 2%;
    opacity: 0.045;
    top: 6%;
}

.pkr-auth-pane-watermark--bl {
    bottom: 2%;
    font-size: clamp(88px, 14vw, 120px);
    inset-inline-start: -4%;
    opacity: 0.04;
}

.pkr-auth-corner {
    font-size: 10px;
    opacity: 0.55;
    z-index: 6;
}

@media (max-width: 640px) {
    :root {
        --pkr-auth-card-w: min(370px, calc(100vw - 72px));
        --pkr-auth-inner-pad-x: 20px;
        --pkr-auth-inner-pad-top: 24px;
        --pkr-auth-inner-pad-bottom: 22px;
        --pkr-auth-input-h: 44px;
        --pkr-auth-primary-h: 46px;
        --pkr-auth-logo-w: clamp(108px, 28vw, 126px);
        --pkr-auth-icon-slot: 36px;
        --pkr-auth-eye-slot: 44px;
        --pkr-auth-gap-brand-title: 12px;
        --pkr-auth-gap-title-body: 16px;
        --pkr-auth-gap-field: 14px;
        --pkr-auth-gap-label: 6px;
        --pkr-auth-gap-action: 14px;
        --pkr-auth-gap-forgot: 20px;
        --pkr-auth-gap-divider: 20px;
    }

    body.fa-ui {
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 100dvh;
        min-height: 100svh;
        overflow-x: clip;
        overflow-y: auto;
    }

    .login.pkr-auth-shell {
        margin: auto;
        padding:
            max(14px, env(safe-area-inset-top, 0px))
            0
            max(18px, env(safe-area-inset-bottom, 0px));
    }

    .pkr-auth-stage-slot {
        min-height: auto;
    }

    .pkr-auth-pane-watermark {
        display: none;
    }

    .pkr-auth-corner,
    .pkr-auth-corner-cut {
        opacity: 0.22;
    }

    .pkr-auth-pane__title {
        font-size: 15px;
    }

    .login.pkr-auth-shell .pkr-auth-input-shell .pkr-auth-input {
        font-size: 16px;
        height: var(--pkr-auth-input-h);
        min-height: var(--pkr-auth-input-h);
        padding-block: 0;
        padding-inline-end: var(--pkr-auth-icon-slot);
        padding-inline-start: 12px;
        scroll-margin-bottom: 28vh;
        scroll-margin-top: 16px;
    }

    .login.pkr-auth-shell .pkr-auth-input-shell--plain .pkr-auth-input {
        padding-inline-end: 14px;
        padding-inline-start: 14px;
    }

    .login.pkr-auth-shell .pkr-auth-input-shell--pass .pkr-auth-input {
        padding-inline-end: var(--pkr-auth-icon-slot);
        padding-inline-start: var(--pkr-auth-eye-slot);
    }

    .pkr-auth-field__toggle {
        height: 40px;
        inset-inline-end: 2px;
        width: 40px;
    }

    .pkr-auth-field__toggle svg {
        height: 18px;
        width: 18px;
    }

    .pkr-auth-field:has(.pkr-auth-password-hint) .pkr-auth-input::placeholder {
        color: transparent;
    }

    .login.pkr-auth-shell .pkr-auth-password-hint {
        color: rgba(164, 141, 128, 0.82);
        direction: rtl;
        display: block;
        font-size: 11px;
        line-height: 1.45;
        margin: 6px 0 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        position: static;
        text-align: right;
        white-space: normal;
    }

    .login.pkr-auth-shell span.note {
        direction: rtl;
        line-height: 1.5;
        max-width: 100%;
        overflow-wrap: anywhere;
        position: static;
        text-align: right;
        white-space: normal;
    }
}

@media (max-width: 340px) {
    :root {
        --pkr-auth-card-w: min(420px, calc(100vw - 24px));
    }
}

/*
 * Phone landscape (iPhone ~844×390 misses max-width: 640px).
 * Document scroll, same as the portrait login shell. No fixed height.
 * Side padding is the notch: login already uses viewport-fit=cover.
 */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
    :root {
        --pkr-auth-card-w: min(404px, calc(100vw - 36px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    }

    html {
        height: auto;
        min-height: 100%;
        overflow-x: clip;
        overflow-y: auto;
    }

    body.fa-ui {
        align-items: flex-start;
        box-sizing: border-box;
        height: auto;
        justify-content: flex-start;
        max-width: 100%;
        min-height: 100dvh;
        min-height: 100svh;
        overflow-x: clip;
        overflow-y: visible;
        padding:
            env(safe-area-inset-top, 0px)
            env(safe-area-inset-right, 0px)
            env(safe-area-inset-bottom, 0px)
            env(safe-area-inset-left, 0px);
        width: 100%;
    }

    .login.pkr-auth-shell {
        margin: 8px auto 16px;
    }

    .pkr-auth-stage-slot {
        min-height: auto;
    }

    .login.pkr-auth-shell input,
    .login.pkr-auth-shell textarea,
    .login.pkr-auth-shell button,
    .login.pkr-auth-shell a,
    .login.pkr-auth-shell .loginbtn,
    .login.pkr-auth-shell .pkr-auth-input {
        scroll-margin-bottom: 28vh;
        scroll-margin-top: 16px;
    }
}
