/* ── Satoshi font-faces ─────────────────────────────────────────────────── */

@font-face {
    font-family: 'Satoshi-Light';
    src: url('./dist/fonts/Satoshi-Light.woff2') format('woff2'), url('./dist/fonts/Satoshi-Light.woff') format('woff'), url('./dist/fonts/Satoshi-Light.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi-Regular';
    src: url('./dist/fonts/Satoshi-Regular.woff2') format('woff2'), url('./dist/fonts/Satoshi-Regular.woff') format('woff'), url('./dist/fonts/Satoshi-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi-Medium';
    src: url('./dist/fonts/Satoshi-Medium.woff2') format('woff2'), url('./dist/fonts/Satoshi-Medium.woff') format('woff'), url('./dist/fonts/Satoshi-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi-Bold';
    src: url('./dist/fonts/Satoshi-Bold.woff2') format('woff2'), url('./dist/fonts/Satoshi-Bold.woff') format('woff'), url('./dist/fonts/Satoshi-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi-Black';
    src: url('./dist/fonts/Satoshi-Black.woff2') format('woff2'), url('./dist/fonts/Satoshi-Black.woff') format('woff'), url('./dist/fonts/Satoshi-Black.ttf') format('truetype');
    font-weight: 900;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi-Variable';
    src: url('./dist/fonts/Satoshi-Variable.woff2') format('woff2'), url('./dist/fonts/Satoshi-Variable.woff') format('woff'), url('./dist/fonts/Satoshi-Variable.ttf') format('truetype');
    font-weight: 300 900;
    font-display: swap;
    font-style: normal;
}

/* ── COMAX colours ──────────────────────────────────────────────────────── */
:root {
    --comax-navy: #1E1C4D;
    --comax-blue: #357BBA;
    --comax-purple: #2A2769;
    --comax-pink: #E42671;
    --comax-orange: #E96029;
    --comax-gray: #9499A1;
    --comax-offwhite: #F6F4F4;
    --comax-lightgray: #F0F0F0;
    --comax-darkgray: #A2A5B1;
    --comax-gradient: linear-gradient(125deg, var(--comax-pink) 0%, var(--comax-orange) 75%);
    --comax-header-gradient: linear-gradient(to right, var(--comax-blue) -50%, var(--comax-purple) 120%);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html, body {
    font-family: Satoshi-Regular, Roboto, Arial, sans-serif;
    font-size: 18px;
    background: #fff;
    margin: 0;
    height: 100%;
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: Satoshi-Bold, Roboto, Arial, sans-serif;
}

/* ── Layout shell ───────────────────────────────────────────────────────── */
.public-layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 3rem 0;
    position: relative;
    z-index: 10;
}

.brand-link {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    max-width: 286px;
    display: block;
}

.culture-selector-wrapper {
    flex-shrink: 0;
}

/* Wave decoration — right edge (desktop) */
.fixed-svg-right {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: auto;
    display: flex;
    align-items: stretch;
    pointer-events: none;
    z-index: 0;
}

    .fixed-svg-right img {
        height: 100vh;
        width: auto;
        display: block;
        max-width: 50vw;
    }

/* Main content area */
.portal-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    padding-left: 4rem;
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .portal-content {
        width: 80vw;
        max-width: 1000px;
        min-width: 800px;
    }
}

/* Wave decoration — bottom (mobile) */
.fixed-svg-bottom {
    overflow: hidden;
    margin-top: -200px;
    pointer-events: none;
    z-index: 0;
}

    .fixed-svg-bottom img {
        width: 100vw;
        min-width: 500px;
        height: auto;
        display: block;
        margin-bottom: -300px;
    }

@media (max-width: 767px) {
    .public-header {
        padding: 1.5rem 1.5rem 0;
    }

    .portal-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .fixed-svg-bottom {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        overflow: visible;
        margin-top: 0;
    }

        .fixed-svg-bottom img {
            width: 100%;
            min-width: unset;
        }
}

/* ── Responsive display helpers ─────────────────────────────────────────── */
.d-none {
    display: none !important;
}

.d-md-flex {
    display: none !important;
}

.d-md-none {
    display: block !important;
}

@media (min-width: 768px) {
    .d-md-flex {
        display: flex !important;
    }

    .d-md-none {
        display: none !important;
    }
}

/* ── MudBlazor — primary filled button → COMAX gradient pill ───────────── */
.mud-button-filled.mud-button-filled-primary {
    background: var(--comax-gradient);
    background-size: 200%;
    background-position: 0% 100%;
    border-radius: 40px !important;
    height: 64px;
    padding: 0 2rem !important;
    font-size: 20px;
    font-family: Satoshi-Bold, Roboto, Arial, sans-serif;
    font-weight: 700;
    text-transform: none;
    border: none;
    transition: background-position .4s ease-in-out, box-shadow .2s;
    box-shadow: none !important;
}

    .mud-button-filled.mud-button-filled-primary:hover {
        background-position: 90% 100%;
        box-shadow: none !important;
    }

/* ── MudBlazor — outlined/text buttons → navy ──────────────────────────── */
.mud-button-text.mud-button-text-primary,
.mud-button-outlined.mud-button-outlined-primary {
    color: var(--comax-navy) !important;
    border-color: var(--comax-navy) !important;
    border-radius: 40px !important;
    height: 44px;
    padding: 0 1.25rem !important;
    font-size: 16px;
    text-transform: none;
    font-family: Satoshi-Medium, Roboto, Arial, sans-serif;
}

    .mud-button-outlined.mud-button-outlined-primary:disabled {
        background-color: var(--comax-lightgray) !important;
        border-color: white !important;
        color: var(--comax-darkgray) !important;
    }

/* ── MudBlazor — text inputs → tall, rounded ───────────────────────────── */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 12px !important;
}

.mud-input-slot {
    font-family: Satoshi-Regular, Roboto, Arial, sans-serif;
}

/* Increase outlined input height to match Identity Server (64px) */
.mud-input-control .mud-input.mud-input-outlined {
    height: 64px;
}

/* ── Label above input ───────────────────────────────────────────────────── */
.login-control-label {
    display: block;
    font-family: Satoshi-Medium, Roboto, Arial, sans-serif;
    font-size: 16px;
    color: var(--comax-navy);
    margin-bottom: 10px;
}

/* ── MudBlazor outlined input — focus state ─────────────────────────────── */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #3ec6ff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 133, 189, 0.25) !important;
    border-width: 1px !important;
}

/* ── Submit button — same size as outlined form buttons ─────────────────── */
.btn-submit-sm.mud-button-filled.mud-button-filled-primary {
    height: 44px !important;
    font-size: 16px !important;
    padding: 0 1.25rem !important;
}

.mud-avatar.mud-avatar-filled.mud-avatar-color-primary {
    background: var(--comax-gradient) !important;
}

/* ── MudBlazor — paper/card ─────────────────────────────────────────────── */
.mud-paper {
    border-radius: 12px !important;
}

/* ── Page layout: vertical stepper left, scrollable form right ──────────── */
.portal-page-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
}

/* MudContainer scroll wrapper */
.portal-body-scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.vertical-stepper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
    padding-top: 28px;
}

@media (max-width: 767px) {
    .vertical-stepper {
        display: none;
    }
}

.stepper-step {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.stepper-label {
    max-width: 120px;
    line-height: 1.3;
}

.stepper-connector {
    width: 2px;
    height: 28px;
    background-color: #e0e4ea;
    margin: 4px 0 4px 19px; /* 19px = half of 40px avatar, centres on circle */
    align-self: flex-start;
}

.stepper-connector--done {
    background-color: var(--mud-palette-success);
}

.portal-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin-top: 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 8px 8px 4px;
}

/* ── Instructions panel ─────────────────────────────────────────────────── */
.instructions-panel {
    background-color: #f4f6f9;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

    .instructions-panel h3,
    .instructions-panel h4 {
        font-family: Satoshi-Bold, Roboto, Arial, sans-serif;
        font-size: 0.95rem;
        color: var(--comax-navy);
        margin: 1.25rem 0 0.5rem;
    }

        .instructions-panel h3:first-child,
        .instructions-panel h4:first-child {
            margin-top: 0;
        }

    .instructions-panel p {
        margin: 0 0 0.75rem;
    }

    .instructions-panel ul,
    .instructions-panel ol {
        padding-left: 1.4rem;
        margin: 0 0 0.75rem;
    }

    .instructions-panel li {
        margin-bottom: 0.3rem;
    }

    .instructions-panel code {
        background: #e8ecf0;
        padding: 0.1em 0.4em;
        border-radius: 3px;
        font-size: 0.85em;
        word-break: break-all;
    }

    .instructions-panel a {
        color: var(--comax-blue);
    }

    .instructions-panel strong {
        color: var(--comax-navy);
    }

/* ── Error UI ────────────────────────────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ── Validation / misc ───────────────────────────────────────────────────── */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmU9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Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
