/* ───────────────────────────────────────────────────────────────────────────
   Expert Group Identity — auth pages brand stylesheet (replaces styles.css).
   Mirage page, white card, Mirage/Fiord text, Onest, flat. Loaded AFTER
   bootstrap so brand tokens win. Re-implements every class the views use so no
   view markup change is required for the common cases.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
    --eg-white: #ffffff;
    --eg-mirage: #18222c;
    --eg-fiord: #283747;
    --eg-fiord-hover: #18222c;
    --eg-blue-bayoux: #3e546b;
    --eg-waikawa: #597695;
    --eg-amaranth: #e63946;
    --eg-cardinal: #ba202c;
    --eg-gray-med-1: #4a5461;
    --eg-gray-med-2: #808c9e;
    --eg-gray-light-1: #cfd9ea;
    --eg-gray-light-2: #dce5f4;
    --eg-surface-subtle: #f2f6fc;
    --eg-card-border: #e2e8f2;
    --eg-success: #0e7a52;
    --eg-warn: #b8860b;
    --eg-danger: #e63946;
    --eg-card-radius: 16px;
    --eg-control-radius: 6px;
    --eg-control-h: 44px;
    --eg-btn-h: 46px;
    --eg-shadow-whisper: 0 8px 32px rgba(24, 34, 44, 0.16);
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Onest', Arial, sans-serif !important;
    background: var(--eg-mirage);
    color: var(--eg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bottom-right brand watermark over the Mirage field. */
body::after {
    content: '';
    position: fixed;
    right: -40px;
    bottom: -40px;
    width: 560px;
    max-width: 60vw;
    height: 560px;
    max-height: 60vh;
    background: url('/brand/mark-watermark-slate.png') no-repeat right bottom;
    background-size: contain;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

.eg-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.eg-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

/* Logo: top-left of the viewport (brand frame), white horizontal mark. */
.eg-image {
    position: fixed;
    top: 28px;
    left: 32px;
    width: 152px;
    margin: 0;
    z-index: 2;
}

.eg-image img {
    width: 100%;
    display: block;
}

/* Old teal tagline graphic is replaced by the footer line; hide if still present. */
.tagline-image {
    display: none;
}

.eg-card {
    display: flex;
    flex-direction: column;
    width: 27rem;
    max-width: 98%;
    padding: 2.4rem;
    background-color: var(--eg-white);
    color: var(--eg-mirage);
    border: 1px solid var(--eg-card-border);
    border-radius: var(--eg-card-radius);
    box-shadow: var(--eg-shadow-whisper);
    overflow-x: hidden;
}

/* Wider variant for consent / announcement screens. */
.eg-card.eg-card--wide {
    width: 32rem;
}

.info-message {
    color: var(--eg-mirage);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.form-floating {
    margin-bottom: 1rem;
}

/* Buttons */
.btn:not(.btn-link) {
    height: var(--eg-btn-h);
    border-radius: var(--eg-control-radius) !important;
    font-weight: 600 !important;
    font-size: 1rem;
}

.btn.btn-primary {
    background-color: var(--eg-fiord);
    border-color: var(--eg-fiord);
    color: #fff;
    width: 100%;
}

.btn.btn-primary:hover,
.btn.btn-primary:active {
    background-color: var(--eg-fiord-hover) !important;
    border-color: var(--eg-fiord-hover);
}

/* Secondary / "use another account" / Microsoft — white with subtle border. */
.btn.btn-secondary {
    background-color: #fff;
    border: 1.5px solid var(--eg-gray-light-1);
    color: var(--eg-mirage);
    width: 100%;
}

.btn.btn-secondary:hover {
    background-color: var(--eg-surface-subtle) !important;
    border-color: var(--eg-gray-light-1);
    color: var(--eg-mirage);
}

.btn.btn-context {
    height: 2rem;
    line-height: 1rem;
}

.btn.btn-link {
    color: var(--eg-blue-bayoux);
    text-decoration: none;
    font-weight: 500;
}

.btn.btn-link:hover {
    color: var(--eg-fiord);
}

/* Inputs */
.form-control,
.form-select {
    height: var(--eg-control-h);
    border-radius: var(--eg-control-radius) !important;
    border: 1.5px solid var(--eg-gray-light-1) !important;
    box-shadow: none;
    color: var(--eg-mirage);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--eg-waikawa) !important;
    box-shadow: 0 0 0 3px rgba(89, 118, 149, 0.18) !important;
}

.form-control::placeholder {
    color: var(--eg-gray-med-2);
}

.form-floating > label {
    color: var(--eg-gray-med-2);
}

/* "ili" divider (Login: between primary form and Microsoft) */
.eg-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--eg-gray-med-2);
    font-size: 0.85rem;
    margin: 1.25rem 0;
}
.eg-divider::before,
.eg-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--eg-gray-light-2);
}
.eg-divider:not(:empty)::before {
    margin-right: 0.75rem;
}
.eg-divider:not(:empty)::after {
    margin-left: 0.75rem;
}

/* Password strength meter — keep the .levelN class names (driven by inline JS). */
.score-result,
.score-strength {
    align-items: center;
    font-size: 0.75rem;
    color: var(--eg-gray-med-2);
}

.password-progress-wrap {
    margin: 5px 0;
    height: 8px;
    border-radius: 8px;
    background-color: var(--eg-gray-light-2);
}

.password-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 8px;
    transition: width 250ms ease-out;
}

.password-progress-bar.level0 {
    width: 20%;
    background-color: var(--eg-danger);
}
.password-progress-bar.level1 {
    width: 40%;
    background-color: var(--eg-danger);
}
.password-progress-bar.level2 {
    width: 60%;
    background-color: var(--eg-warn);
}
.password-progress-bar.level3 {
    width: 80%;
    background-color: var(--eg-success);
}
.password-progress-bar.level4 {
    width: 100%;
    background-color: var(--eg-success);
}

.additional {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0 0;
    gap: 0.5rem;
}

.error-messages ul {
    list-style-type: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.error-message {
    color: var(--eg-danger);
    margin: 0.25em 0;
}

.informations {
    color: var(--eg-gray-med-1);
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.description {
    color: var(--eg-gray-med-1);
}

.question-primary {
    color: var(--eg-mirage);
    font-weight: 600;
}

/* Info note box (recovery / Entra allow-list / etc.) */
.eg-note {
    background: var(--eg-surface-subtle);
    border: 1px solid var(--eg-gray-light-2);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    color: var(--eg-gray-med-1);
    font-size: 0.9rem;
}

/* Signature acknowledgement */
.signature-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
}

.signature-label {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--eg-mirage);
}

.signature-input {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.signature-canvas {
    box-sizing: border-box;
    border: 1.5px solid var(--eg-gray-light-1);
    border-radius: var(--eg-control-radius);
    background-color: #ffffff !important;
}

.invalid-feedback {
    color: var(--eg-danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Checkboxes */
.form-check {
    margin: 1.25rem 0 !important;
}

.form-check-label {
    color: var(--eg-mirage) !important;
}

.form-check-input:checked {
    background-color: var(--eg-fiord);
    border-color: var(--eg-fiord);
}

/* Announcements */
.announcement-content {
    width: 100%;
    background: var(--eg-surface-subtle);
    color: var(--eg-mirage);
    padding: 1.1rem !important;
    border: 1px solid var(--eg-gray-light-2);
    border-radius: 10px;
    overflow-y: auto;
    white-space: unset !important;
}

.announcement-content li {
    list-style-type: unset !important;
    padding-left: unset !important;
}

.announcement-content p {
    margin-bottom: 1rem !important;
}

/* Mandatory announcement eyebrow + accent border. */
.eg-eyebrow {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--eg-gray-med-2);
    margin-bottom: 0.5rem;
}

.eg-eyebrow--required {
    color: var(--eg-amaranth);
}

.eg-card.eg-card--required {
    border-left: 3px solid var(--eg-amaranth);
}

/* Footer line (set by _Layout). */
.eg-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--eg-gray-med-2);
    font-size: 11.5px;
    margin-top: 1.5rem;
}

/* Account-locked accent tile (the one place red dominates). */
.eg-lock-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(230, 57, 70, 0.12);
    color: var(--eg-amaranth);
    margin-bottom: 1rem;
}

@media (min-width: 576px) {
    .eg-card {
        padding: 2.8rem;
    }
}
