/* Company portal — brand-specific overrides (loads after Shared.UI customer-portal + form CSS) */

:root {
    --brand-500: #005caa;
    --brand-600: #004a8a;
    --header: #001a41;
    --header-mid: #003a7a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.cp-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* ── Hero ─────────────────────────────────────────── */

.cp-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--header);
}

.cp-hero__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cp-hero__content {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 48rem;
    padding: 2.5rem 1rem 8rem;
    text-align: center;
    min-height: 12.5rem;
}

.cp-hero__logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    height: 2.5rem;
    min-height: 2.5rem;
}

.cp-hero__logo-slot {
    display: block;
    width: 9rem;
    height: 2.5rem;
    flex-shrink: 0;
}

.cp-hero__logo {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 144 / 40;
    object-fit: contain;
    object-position: center;
    filter: brightness(0) invert(1);
}

.cp-hero__divider {
    display: block;
    width: 1px;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.8);
}

.cp-hero__title {
    margin: 1.75rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: #fff;
}

.cp-hero__title:focus {
    outline: none;
}

.cp-hero__subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgba(219, 234, 254, 0.85);
}

@media (min-width: 640px) {
    .cp-hero__content {
        padding-top: 3rem;
        min-height: 13.5rem;
    }

    .cp-hero__logos {
        height: 2.75rem;
        min-height: 2.75rem;
        gap: 1.5rem;
    }

    .cp-hero__logo-slot {
        width: 10rem;
        height: 2.75rem;
    }

    .cp-hero__title {
        font-size: 1.875rem;
    }
}

/* Login/auth — override Shared.UI customer-portal orange defaults with company brand tokens */

.cp-login-main {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 36rem;
    margin: -6rem auto 0;
    padding: 0 1rem 2.5rem;
    flex: 1;
}

.cp-login-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 1.75rem 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 26, 65, 0.16);
}

@media (min-width: 640px) {
    .cp-login-card {
        padding: 2.25rem 2rem;
    }
}

.cp-login-intro {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
}

.cp-login-form {
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cp-field-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cp-field-icon {
    display: flex;
    height: 2.5rem;
    width: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--brand-500) 12%, transparent);
    color: var(--brand-500);
}

.cp-field-icon svg,
.cp-field-icon .blazicon {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.cp-field-label {
    display: block;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.cp-field-help {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #64748b;
}

.cp-required {
    color: #f43f5e;
}

.cp-input {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.8rem 0.95rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cp-input::placeholder {
    color: #94a3b8;
}

.cp-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}

.cp-actions-row {
    display: flex;
    justify-content: flex-end;
}

.cp-link {
    color: var(--brand-500);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.cp-link:hover {
    text-decoration: underline;
    color: var(--brand-600);
}

.cp-btn-primary {
    display: inline-flex;
    width: 100%;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--brand-500);
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cp-btn-primary svg,
.cp-btn-primary .blazicon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.cp-btn-primary:hover:not(:disabled) {
    background: var(--brand-600);
}

.cp-btn-primary:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

.cp-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cp-alert-error {
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #fecdd3;
    background: #fff1f2;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #9f1239;
}

.cp-alert-success {
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #065f46;
}

.cp-back-row {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.cp-passport-dropzone {
    position: relative;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 1rem;
    border: 2px dashed #e2e8f0;
    background: rgba(248, 250, 252, 0.8);
    padding: 2rem 1rem;
    text-align: center;
}

.cp-passport-dropzone--filled {
    border-color: color-mix(in srgb, var(--brand-500) 35%, #e2e8f0);
    background: color-mix(in srgb, var(--brand-500) 6%, #fff);
}

.cp-passport-dropzone--invalid {
    border-color: #f43f5e;
    background: #fff1f2;
}

.cp-passport-dropzone__input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.cp-passport-dropzone__content {
    pointer-events: none;
}

.cp-passport-dropzone__icon {
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #64748b;
}

.cp-passport-dropzone__icon svg,
.cp-passport-dropzone__icon .blazicon {
    width: 1.25rem;
    height: 1.25rem;
}

.cp-passport-dropzone__title {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.cp-passport-dropzone__hint {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.cp-passport-dropzone__filename {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-500);
}

.cp-passport-upload-note {
    margin: 0.5rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.cp-passport-upload-resume {
    margin-top: 0.75rem;
    text-align: center;
}

.cp-passport-alt-link {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
}

.cp-passport-alt-link:hover:not(:disabled) {
    color: var(--brand-500);
    text-decoration: underline;
}

.cp-passport-alt-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cp-passport-review-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .cp-passport-review-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cp-passport-review-label {
    display: block;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.cp-passport-review-input {
    margin-top: 0.25rem;
}

.cp-passport-review-hint {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}


.cp-passport-reading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

.cp-passport-reading-overlay__card {
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    background: #fff;
    padding: 1.25rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 26, 65, 0.12);
}

.cp-passport-reading-overlay__spinner {
    margin: 0 auto;
    height: 2rem;
    width: 2rem;
    color: var(--brand-500);
    animation: spin 1s linear infinite;
}

.cp-passport-reading-overlay__title {
    margin: 0.625rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.cp-passport-reading-overlay__hint {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shared UI selects — brand focus ring + shared scrollbar on dropdown lists */
.company-portal-form .su-searchable-select__trigger {
    min-height: 2.75rem;
    border-radius: 0.75rem;
    border-color: #e2e8f0;
    font-size: 0.875rem;
}

.company-portal-form .su-searchable-select--open .su-searchable-select__trigger,
.company-portal-form .su-searchable-select__trigger:focus,
.company-portal-form .su-searchable-select__trigger:focus-visible {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}

.company-portal-form .su-searchable-select__item--selected {
    background: color-mix(in srgb, var(--brand-500) 12%, #fff);
    color: var(--header-mid);
}

.company-portal-form .su-searchable-select__item:hover {
    background: color-mix(in srgb, var(--brand-500) 8%, #fff);
    color: var(--header-mid);
}

/* Radzen dropdown panels (if any remain) */
.rz-dropdown-items-wrapper.su-scrollbar {
    max-height: 14rem;
}

/* ── Page & boot loaders ──────────────────────────── */

.cp-page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.35rem;
    min-height: 16rem;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
}

.cp-page-loader__visual {
    width: 100%;
    display: flex;
    justify-content: center;
}

.cp-loader-monitor {
    position: relative;
    width: 16rem;
    height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-loader-monitor__device {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10rem;
    height: 10rem;
}

.cp-loader-monitor__device svg,
.cp-loader-monitor__frame,
svg.cp-loader-monitor__frame {
    width: 10rem !important;
    height: 10rem !important;
    min-width: 10rem;
    min-height: 10rem;
    color: #cbd5e1;
    stroke-width: 1.35;
}

.cp-loader-monitor__mark {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 2.75rem;
    height: 2.75rem;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}

.cp-loader-monitor__mark--visible {
    opacity: 1;
    visibility: visible;
}

.cp-loader-monitor__dot {
    position: absolute;
    border-radius: 50%;
    background: var(--header-mid, #003a7a);
}

.cp-loader-monitor__dash {
    position: absolute;
    height: 0.22rem;
    border-radius: 999px;
    background: #cbd5e1;
}

.cp-page-loader__copy {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 22rem;
}

.cp-page-loader__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--header-mid, #003a7a);
}

.cp-page-loader__subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #64748b;
}

.cp-loader-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.cp-loader-steps__dot {
    width: 0.95rem;
    height: 0.45rem;
    border-radius: 8px;
    background: #cbd5e1;
}

.cp-loader-steps__dot--active {
    width: 1.15rem;
    background: var(--header-mid, #003a7a);
}

/* Boot splash — full-page branded shell before Blazor loads */

.cp-loader-shell {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    background: #fafbfc;
}

.cp-loader-shell--boot {
    z-index: 10000;
}

#portal-boot-loader[hidden] {
    display: none !important;
}

.cp-loader-shell__backdrop,
.cp-loader-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cp-loader-shell__backdrop {
    object-fit: cover;
}

.cp-loader-shell__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 36rem;
    padding: 2rem 1rem;
}

.cp-loader-shell__logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    height: 2.75rem;
}

.cp-logo-brand {
    display: block;
    height: 2.75rem;
    width: 9.5rem;
    max-width: 11rem;
    flex-shrink: 0;
    background-color: var(--header-mid, #003a7a);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
}

.cp-logo-brand--company {
    width: 10.5rem;
}

.cp-loader-company-logo {
    display: block;
    height: 2.75rem;
    width: auto;
    max-width: 11rem;
    object-fit: contain;
}

.cp-loader-shell__divider {
    display: block;
    width: 1px;
    height: 2.25rem;
    background: color-mix(in srgb, var(--header-mid, #003a7a) 30%, #cbd5e1);
}

.cp-loader-shell__card {
    width: 100%;
    background: #fff;
    border-radius: 1.5rem;
    padding: 2.5rem 1.5rem 2rem;
    box-shadow: 0 20px 50px rgba(0, 26, 65, 0.12);
}

.cp-page-loader--embedded {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.35rem;
    min-height: auto;
    padding: 0;
    text-align: center;
}

.cp-boot-loader {
    gap: 1.35rem;
}

.cp-boot-loader__copy {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 22rem;
}

.cp-boot-loader__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--header-mid, #003a7a);
}

.cp-boot-loader__subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #64748b;
}

/* Neutral XPATWEB entry page shown before a company invitation route is opened. */

.cp-entry-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: #eef3f8;
    padding: 2rem 1rem;
}

.cp-entry-page::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("/_content/Xp.Solutions.Shared.UI/images/loader-backdrop.svg") center / cover no-repeat;
    content: "";
    opacity: 0.85;
}

.cp-entry-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 34rem;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    background: #fff;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 26, 65, 0.1);
}

.cp-entry-logo {
    display: block;
    width: min(13rem, 80%);
    height: auto;
    margin: 0 auto 2rem;
}

.cp-entry-title {
    margin: 0;
    color: var(--header-mid, #003a7a);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    outline: none;
}

.cp-entry-copy {
    margin: 1rem 0 0;
    color: #334155;
    font-size: 1rem;
    line-height: 1.5;
}

.cp-entry-help {
    margin: 0.75rem 0 0;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .cp-entry-card {
        padding: 3rem 2.5rem;
    }
}

/* Per-company brand tokens — overrides Shared.UI orange defaults (loads after btn.css). */
.cp-page,
.cp-loader-shell {
    --rz-primary: var(--brand-500) !important;
    --rz-secondary: var(--header-mid) !important;
    --su-primary: var(--brand-500);
    --su-secondary: var(--header-mid);
    --su-orange: var(--brand-500);
    --su-orange-dark: var(--brand-600);
    --cp-brand: var(--brand-500);
}

.cp-page .su-btn.rz-button.rz-primary.rz-variant-flat {
    background-color: var(--brand-500) !important;
    border-color: var(--brand-500) !important;
}

.cp-page .su-btn.rz-button.rz-primary.rz-variant-flat:hover:not(:disabled):not(.rz-state-disabled) {
    background-color: var(--brand-600) !important;
    border-color: var(--brand-600) !important;
    filter: none;
}

.cp-page .su-btn.rz-button.rz-secondary.rz-variant-outlined {
    color: var(--header-mid) !important;
    border-color: var(--header-mid) !important;
}

.cp-page .su-btn.rz-button.rz-secondary.rz-variant-outlined:hover:not(:disabled):not(.rz-state-disabled) {
    background-color: color-mix(in srgb, var(--header-mid) 8%, transparent) !important;
}

.cp-login-main .su-btn.rz-button.rz-primary.rz-variant-flat {
    background-color: var(--brand-500) !important;
    border-color: var(--brand-500) !important;
}

.cp-login-main .su-btn.rz-button.rz-primary.rz-variant-flat:hover:not(:disabled):not(.rz-state-disabled) {
    background-color: var(--brand-600) !important;
    border-color: var(--brand-600) !important;
    filter: none;
}
