/* `min-height: 100dvh` rather than `position: fixed; inset: 0; overflow: auto` — same change, and
   for the same reason, as .login-bg-default / .register-bg-default in the scoped stylesheets. The
   fixed box made itself the scroller while AuthLayout's logo sits outside it, so the logo could not
   scroll and `align-items: center` pushed the card's top into overflow that no scroll position
   reaches. In normal flow the document scrolls and a tall card grows this box instead. */
.forgot-password-page {
    background-color: #ffffff;
    background-image: url('_content/AttituXPortal.Shared/attitux_stripes_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100dvh;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 2rem;
    padding-left: clamp(7rem, 18vw, 18rem);
    font-family: var(--mud-typography-default-family);
    color: var(--mud-palette-text-primary);
}

/* This duplicates the .drawmetrics-layout block in LoginBase.razor.css, and being global it is what
   actually took effect on /Account/Drawmetrics/Login: measured on the drawmetrics host at 1440x420,
   the login card sat at top -31px with maxScroll 0 — its first 31px unreachable — because this copy
   was still `position: fixed`. Both copies now use normal flow; leaving one behind is what hid the
   bug when the scoped copy alone was fixed. */
.drawmetrics-layout {
    display: flex;
    min-height: 100dvh;
    box-sizing: border-box;
}

.drawmetrics-left-panel {
    flex: 1;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.drawmetrics-right-panel {
    flex: 1;
    background-image: url('_content/AttituXPortal.Shared/drawmetrics-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

.forgot-password-panel {
    --forgot-password-panel-shadow: var(--portal-auth-card-shadow, 0 16px 40px rgba(0, 0, 0, 0.28));
    --forgot-password-control-background: var(--mud-palette-action-disabled-background, #e0e0e0);
    --forgot-password-control-background-hover: var(--mud-palette-action-disabled, #d6d6d6);
    --forgot-password-mail-background: var(--portal-forgot-password-mail-base, #ef5350);
    --forgot-password-mail-accent: var(--portal-forgot-password-mail-flap, #e53935);
    --forgot-password-mail-accent-soft: var(--portal-forgot-password-mail-soft, #e57373);

    width: 100%;
    /* Card width is capped at 380px on desktop to maintain a compact, clean form
       matching dev layout, preventing inputs, buttons, and titles from inflating on wide screens
       and ensuring the entire form fits within standard viewport heights without vertical scrolling. */
    max-width: 380px;
    background: var(--portal-auth-panel-background, #ffffff);
    color: var(--mud-palette-text-primary, #212121);
    border: 1px solid var(--portal-auth-card-border, rgba(0, 0, 0, 0.12));
    border-radius: 16px;
    box-shadow: var(--forgot-password-panel-shadow);
    box-sizing: border-box;
    padding: 20px 24px 28px;
}

.reset-password-panel {
    min-height: 434px;
    padding-bottom: 86px;
}

.forgot-password-back.mud-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mud-palette-text-primary);
    font-size: 14px;
    line-height: 1;
    margin-bottom: 20px;
}

.forgot-password-back.mud-link:hover {
    color: var(--mud-palette-primary);
}

.forgot-password-mail-art {
    position: relative;
    width: 94px;
    height: 91px;
    margin: 20px auto 24px;
}

.mail-sheet {
    position: absolute;
    top: 1px;
    left: 18px;
    z-index: 3;
    width: 58px;
    height: 60px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--portal-divider-color);
    color: var(--mud-palette-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-sizing: border-box;
}

.mail-sheet::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 23px;
    width: 13px;
    height: 7px;
    border-radius: 8px 8px 0 0;
    background: var(--forgot-password-mail-accent);
    z-index: -1;
}

.mail-envelope {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 94px;
    height: 52px;
    background: var(--forgot-password-mail-background);
    overflow: visible;
}

.mail-flap {
    content: "";
    position: absolute;
    left: 0;
    top: -31px;
    z-index: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 47px 32px;
    border-color: transparent transparent var(--forgot-password-mail-accent) transparent;
}

.mail-envelope::before,
.mail-envelope::after {
    content: "";
    position: absolute;
    bottom: 0;
    z-index: 2;
    width: 0;
    height: 0;
    border-style: solid;
}

.mail-envelope::before {
    left: 0;
    border-width: 26px 47px 0 0;
    border-color: var(--forgot-password-mail-accent-soft) transparent transparent transparent;
}

.mail-envelope::after {
    position: absolute;
    right: 0;
    width: 0;
    height: 0;
    border-width: 26px 0 0 47px;
    border-color: var(--forgot-password-mail-accent-soft) transparent transparent transparent;
}

.mail-envelope .mail-flap::after {
    content: "";
    position: absolute;
    left: -47px;
    top: 32px;
    z-index: 3;
    width: 0;
    height: 0;
    border-left: 47px solid transparent;
    border-right: 47px solid transparent;
    border-bottom: 32px solid var(--forgot-password-mail-background);
}

.forgot-password-form {
    display: flex;
    flex-direction: column;
    gap: 21px;
    margin-top: 0;
}

.reset-password-form {
    margin-top: 31px;
}



.forgot-password-dialog-button {
    min-height: 32px;
    height: 32px;
    border-radius: 3px;
    background: var(--forgot-password-control-background);
    color: var(--mud-palette-text-primary);
    box-shadow: var(--portal-appbar-shadow);
    font-size: 13px;
    line-height: 32px;
    text-transform: none;
}

.forgot-password-submit--static {
    display: flex;
    justify-content: center;
    align-items: center;
}

.forgot-password-validation-summary {
    color: var(--mud-palette-error);
    font-size: 13px;
    margin: 12px 0 0;
}

.forgot-password-field-placeholder {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--mud-palette-text-secondary);
    font-size: 13px;
}

.forgot-password-field-placeholder span:last-child {
    height: 36px;
    border: 1px solid var(--portal-divider-color);
    border-radius: 3px;
    color: var(--mud-palette-text-disabled);
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-sizing: border-box;
}

.forgot-password-page--modal::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--portal-external-login-modal-backdrop);
    z-index: 1;
}

.forgot-password-panel--dimmed {
    position: relative;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.forgot-password-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.forgot-password-dialog {
    width: min(506px, calc(100vw - 48px));
    min-height: 307px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border-radius: 13px;
    box-sizing: border-box;
    padding: 62px 64px 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.forgot-password-success-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--mud-palette-success);
    position: relative;
    margin-bottom: 17px;
}

.forgot-password-success-icon::after {
    content: "";
    position: absolute;
    left: 22px;
    top: 20px;
    width: 26px;
    height: 15px;
    border-left: 5px solid var(--mud-palette-success-text);
    border-bottom: 5px solid var(--mud-palette-success-text);
    transform: rotate(-45deg);
    border-radius: 2px;
}

.forgot-password-dialog h2 {
    color: var(--mud-palette-text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    margin: 0 0 18px;
}

.forgot-password-dialog p {
    color: var(--mud-palette-text-secondary);
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 33px;
}

.forgot-password-dialog .forgot-password-dialog-button {
    width: 149px;
    min-height: 28px;
    height: 28px;
    line-height: 28px;
    background: var(--portal-forgot-password-dialog-button-background);
    color: var(--portal-forgot-password-dialog-button-text);
    -webkit-text-fill-color: var(--portal-forgot-password-dialog-button-text);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.forgot-password-dialog .forgot-password-dialog-button:visited {
    color: var(--portal-forgot-password-dialog-button-text);
    -webkit-text-fill-color: var(--portal-forgot-password-dialog-button-text);
}

.forgot-password-dialog .forgot-password-dialog-button:hover,
.forgot-password-dialog .forgot-password-dialog-button:focus,
.forgot-password-dialog .forgot-password-dialog-button:focus-visible,
.forgot-password-dialog .forgot-password-dialog-button:active,
.forgot-password-dialog .forgot-password-dialog-button:hover:visited {
    background: var(--portal-forgot-password-dialog-button-hover-background);
    color: var(--portal-forgot-password-dialog-button-hover-text);
    -webkit-text-fill-color: var(--portal-forgot-password-dialog-button-hover-text);
    text-decoration: none;
}

:is(html, body).portal-dark-mode .forgot-password-page:not(.DrawMetrics) {
    background-color: #0b1220;
    background-image: url('_content/AttituXPortal.Shared/attitux_stripes_bg_dark.png');
}

:is(html, body).portal-dark-mode .drawmetrics-left-panel {
    background-color: #1a2332;
}

:is(html, body).portal-dark-mode .drawmetrics-right-panel {
    background-image: linear-gradient(135deg, rgba(11, 18, 32, 0.84), rgba(22, 31, 48, 0.72)), url('_content/AttituXPortal.Shared/drawmetrics-bg.png');
}

/* ===== Tablet & Mobile (<= 1000px): Form centered horizontally, background bottom-right ===== */
@media (max-width: 1000px) {
    .forgot-password-page:not(.DrawMetrics) {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 11.5rem 1rem 2rem !important;
        padding-left: 1rem !important;
        background-position: right bottom !important;
        background-size: 65% auto !important;
        background-repeat: no-repeat !important;
    }

    .forgot-password-page.DrawMetrics {
        padding: 60px 16px 24px;
        justify-content: center;
        align-items: center;
        min-height: 100dvh;
        background-size: cover;
        background-position: center;
    }

    .forgot-password-panel {
        width: 100% !important;
        max-width: 420px !important;
        padding: 24px 20px 36px;
        transform: none;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
        border-radius: 16px;
    }

    .forgot-password-dialog {
        padding: 36px 24px 28px;
        min-height: auto;
        width: min(420px, calc(100vw - 32px));
    }
}

.drawmetrics-mobile-logo-wrapper {
    display: none;
}

.drawmetrics-right-panel .forgot-password-panel {
    transform: translateY(-20px);
}

@media (max-width: 960px) {
    .drawmetrics-left-panel {
        display: none !important;
    }

    .drawmetrics-right-panel {
        flex: 1 1 100% !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 40px 16px 16px !important;
        min-height: 100dvh;
        gap: 24px;
    }

    .drawmetrics-right-panel .forgot-password-panel {
        transform: none;
    }

    .drawmetrics-mobile-logo-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: white;
        border-radius: 14px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        padding: 10px 18px;
        margin: 0;
    }
}

@media (min-width: 961px) {
    .drawmetrics-mobile-logo-wrapper {
        display: none !important;
    }
}
