/**
 * PowerEn commerce modernization — Phase 11.2 guest login pilot.
 *
 * The stylesheet is enqueued only for the exact guest /login/ request. Every
 * selector also requires the request-scoped HTML opt-in and MihanPanel's RTL
 * body identity, so plugin forms on other routes remain untouched.
 */

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl {
    --pw-login-ink: #082b3c;
    --pw-login-muted: #617783;
    --pw-login-line: #d7e6ec;
    --pw-login-accent: #087f9f;
    --pw-login-accent-dark: #066f8b;
    --pw-login-surface: rgba(255, 255, 255, 0.97);
    color: var(--pw-login-ink);
    font-family: IRANSans, IRANSansWeb, Tahoma, sans-serif;
    background-color: #f3f8fa;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .poweren-login-sr-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-wrapper > form.mwpl-login-form {
    box-sizing: border-box;
    width: min(calc(100% - 32px), 408px);
    margin: auto;
    padding: clamp(26px, 3.2vw, 38px);
    overflow: visible;
    background: var(--pw-login-surface);
    border: 1px solid var(--pw-login-line);
    border-radius: 28px;
    box-shadow:
        0 28px 70px rgba(8, 43, 60, 0.11),
        0 5px 16px rgba(8, 43, 60, 0.05);
    backdrop-filter: blur(12px);
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-login-logo {
    display: flex;
    margin-bottom: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-login-logo:focus-visible {
    outline: 3px solid var(--pw-login-accent);
    outline-offset: 6px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-login-logo img {
    width: 120px;
    max-width: 100%;
    border-radius: 18px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-notice-box.mwpl-form-top-message {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 14px;
    padding: 11px 14px;
    color: var(--pw-login-accent-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
    background: #e9f8fc;
    border: 1px solid rgba(8, 169, 211, 0.18);
    border-radius: 13px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields {
    width: 100%;
    gap: 14px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item:not(.mwpl-field-type-radio) > label {
    box-sizing: border-box;
    min-height: 62px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--pw-login-line);
    border-radius: 14px;
    box-shadow: 0 5px 16px rgba(8, 43, 60, 0.035);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item:not(.mwpl-field-type-radio) > label:focus-within {
    background: #fbfeff;
    border-color: var(--pw-login-accent);
    box-shadow:
        0 0 0 4px rgba(8, 169, 211, 0.16),
        0 10px 24px rgba(8, 43, 60, 0.07);
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-icon {
    width: 28px;
    flex: 0 0 28px;
    opacity: 0.82;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input[type="email"],
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input[type="number"],
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input[type="password"],
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input[type="text"] {
    min-height: 38px;
    color: var(--pw-login-ink);
    font-family: IRANSans, IRANSansWeb, Tahoma, sans-serif;
    font-size: 16.25px;
    font-weight: 500;
    line-height: 1.7;
    caret-color: var(--pw-login-accent-dark);
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input:focus-visible {
    outline: none;
    box-shadow: none;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field .mwpl-label-value {
    color: #334f5d;
    font-family: IRANSans, IRANSansWeb, Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.8;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input:focus + .mwpl-label-value,
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item label .mwpl-field input.mwpl-has-value + .mwpl-label-value {
    color: var(--pw-login-muted);
    font-size: 12px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"] {
    min-height: 56px;
    padding: 13px 18px;
    color: #ffffff;
    font-family: IRANSans, IRANSansWeb, Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
    background: linear-gradient(135deg, var(--pw-login-accent), var(--pw-login-accent-dark));
    border: 1px solid transparent;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(8, 127, 159, 0.22);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        filter 180ms ease;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"]:hover {
    box-shadow: 0 18px 36px rgba(8, 127, 159, 0.28);
    filter: saturate(1.08);
    transform: translateY(-2px);
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"]:focus-visible {
    outline: 3px solid var(--pw-login-accent);
    outline-offset: 4px;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"]:disabled {
    box-shadow: none;
    filter: grayscale(0.2);
    transform: none;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-notice-wrapper {
    gap: 8px;
    color: var(--pw-login-muted);
    font-size: 14px;
    line-height: 1.9;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .resetpassword-btn,
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-back-to-login {
    color: var(--pw-login-accent-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .resetpassword-btn:focus-visible,
html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-back-to-login:focus-visible {
    outline: 3px solid var(--pw-login-accent);
    outline-offset: 4px;
    border-radius: 6px;
}

@media (max-width: 600px) {
    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl {
        background:
            radial-gradient(circle at 50% 0, rgba(8, 169, 211, 0.1), transparent 18rem),
            linear-gradient(180deg, #f8fbfc 0%, #f1f6f8 100%);
    }

    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-wrapper.mwpl-has-cover {
        box-sizing: border-box;
        display: grid;
        min-height: 100vh;
        min-height: 100svh;
        padding-block: 20px;
        align-items: center;
        grid-template-columns: minmax(0, 1fr);
    }

    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-wrapper > form.mwpl-login-form {
        width: min(calc(100% - 20px), 408px);
        padding: 26px 18px;
        border-radius: 24px;
        box-shadow:
            0 22px 50px rgba(8, 43, 60, 0.1),
            0 4px 12px rgba(8, 43, 60, 0.04);
    }

    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-login-logo img {
        width: 110px;
    }

    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item:not(.mwpl-field-type-radio) > label {
        min-height: 64px;
    }
}

@media (max-width: 340px) {
    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-wrapper > form.mwpl-login-form {
        width: calc(100% - 12px);
        padding-inline: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item:not(.mwpl-field-type-radio) > label,
    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"] {
        transition: none;
    }

    html[data-poweren-modern-login="true"] body.mwpl-login-body.mwpl-rtl .mwpl-login-form .mwpl-form-fields .mwpl-input-item.mwpl-spinner-field input[type="submit"]:hover {
        transform: none;
    }
}
