/* Sign-in pages (login, forgot password): a split screen, ported from the INApp framework (FW.V5).
   Left, the brand panel on a flat pastel scene (one of five, see AuthLayout); right, the form on a card.
   No gradients. The accent is the theme's primary colour.

   Global rather than component-scoped: the card is rendered by the page and its inputs and buttons are
   MudBlazor internals, neither of which a layout's scope attribute can reach. The brand panel is fixed
   brand art (pastel ground, dark ink) in every theme and mode; the form side follows the active theme
   through the --mud-palette-* variables, so it works in dark mode and High contrast too. */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    position: relative;
    overflow-x: hidden;
}

@media (min-width: 960px) {
    .auth-page { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* ---- Brand panel ------------------------------------------------ */
/* The scene's four colours: the panel (p0) and the three shapes. */
.auth-scene-0 { --p0: #DCF0F5; --p1: #FDE7C0; --p2: #CDEADF; --p3: #B5DCCD; }
.auth-scene-1 { --p0: #EFE7F7; --p1: #F9DFE3; --p2: #DCCFF0; --p3: #C8BDE6; }
.auth-scene-2 { --p0: #E3F1FB; --p1: #CFE5F7; --p2: #BCD9F1; --p3: #A9CBE9; }
.auth-scene-3 { --p0: #FDF0E1; --p1: #F9D9C4; --p2: #F6E3B6; --p3: #CDE8D9; }
.auth-scene-4 { --p0: #E5F3E7; --p1: #FBE9C6; --p2: #CFE7D2; --p3: #B8D9BF; }

.auth-page-left {
    display: flex;
    position: relative;
    overflow: hidden;
    background: var(--p0, #DCF0F5);
    color: #1B2A4A;
    padding: 36px clamp(28px, 5vw, 72px);
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    z-index: 1;
}

.auth-page-left > :not(.auth-scene) { position: relative; }
.auth-scene { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-scene .f1 { fill: var(--p1); }
.auth-scene .f2 { fill: var(--p2); }
.auth-scene .f3 { fill: var(--p3); }

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 9px 16px 9px 10px;
    box-shadow: 0 1px 2px rgba(27, 42, 74, 0.08);
}

.auth-logo-mark { width: 38px; height: 38px; object-fit: contain; display: block; }
.auth-logo-wm { height: 20px; width: auto; display: block; }

.auth-hero-text { max-width: 480px; }

.auth-hero-text h2 {
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 14px;
    max-width: 16ch;
    text-wrap: balance;
}

.auth-hero-text p { font-size: 1rem; line-height: 1.55; margin: 0; color: #47606F; max-width: 44ch; }

.auth-features { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; }

.auth-feature-icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #FFFFFF;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 2px rgba(27, 42, 74, 0.08);
}

.auth-feature-icon .mud-icon-root { color: #1B2A4A !important; font-size: 20px !important; }
.auth-feature-text { display: flex; flex-direction: column; gap: 2px; }
.auth-feature-title { font-weight: 600; font-size: 0.95rem; }
.auth-feature-sub { font-size: 0.85rem; color: #47606F; }

.auth-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #47606F;
}

/* ---- Form side ------------------------------------------------- */
.auth-page-right {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px clamp(16px, 5vw, 64px);
    background: var(--mud-palette-background);
}

.auth-center {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 24px;
}

.auth-card.mud-paper,
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 34px 32px;
    border-radius: 22px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    box-shadow: 0 12px 36px rgba(26, 26, 46, 0.08);
}

:root[data-infence-mode="dark"] .auth-card.mud-paper,
:root[data-infence-mode="dark"] .auth-card { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4); }
:root[data-infence-theme="contrast"] .auth-card.mud-paper,
:root[data-infence-theme="contrast"] .auth-card { box-shadow: none; }

@media (prefers-reduced-motion: no-preference) {
    .auth-card { animation: auth-fade-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
}

@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card-header { text-align: left; margin-bottom: 22px; }
.auth-card-title { font-weight: 700; letter-spacing: -0.2px; }
.auth-card-subtitle { color: var(--mud-palette-text-secondary); margin-top: 4px; font-size: 0.95rem; }

/* ---- Form ------------------------------------------------------ */
.auth-card .mud-input-control { margin-top: 4px; }
.auth-card .mud-input-outlined .mud-input-outlined-border { border-radius: 11px; }
.auth-card .mud-input-control:focus-within .mud-input-outlined-border { border-width: 2px; }

.auth-form-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px 12px;
    margin-top: 4px;
}

.auth-pw-wrap { display: grid; gap: 4px; }
.auth-caps { font-size: 0.8rem; color: var(--mud-palette-warning); font-weight: 500; }
.auth-caps[hidden] { display: none; }

.auth-card .auth-submit.mud-button {
    margin-top: 10px;
    height: 50px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 11px;
    text-transform: none;
    font-size: 1rem;
    box-shadow: none;
}

.auth-card .auth-submit.mud-button:hover:not(:disabled) { filter: brightness(0.92); }

.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 18px 0 0;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.auth-secure .mud-icon-root { font-size: 16px !important; }
.auth-foot-links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 16px; }

/* ---- Narrow windows: the brand panel becomes a slim strip with the logo ---- */
@media (max-width: 959px) {
    .auth-page-left { padding: 16px 20px; gap: 0; min-height: 0; }
    .auth-hero-text, .auth-foot { display: none; }
    .auth-page-right { min-height: 0; }
}

@media (max-width: 600px) {
    .auth-card.mud-paper,
    .auth-card { padding: 24px 20px; border-radius: 18px; }
}
