/*
 * Contractor portal login. Font, colours, form controls and buttons come from the recruitment portal's
 * stylesheets loaded before this file; the layout and the graphite-and-orange palette are the portal's own:
 * a split screen with a charcoal panel over a line drawing of the mine and plant, and the sign-in card.
 */
.portal-login {
    --pl-orange: #f07a1a;
    --pl-orange-deep: #d9580c;
    --pl-amber: #ffb35c;
    --pl-graphite: #2b3036;
    --pl-ink: #22272d;
    background: #f3f2f0;
}

.portal-split {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Visual panel ---------- */
.portal-split__visual {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 36px clamp(28px, 5vw, 72px) clamp(200px, 19vw, 270px);
    overflow: hidden;
    color: #fff;
    background:
        url("/images/login-schematic.svg") center bottom / 100% auto no-repeat,
        radial-gradient(circle at 85% 8%, rgba(240, 122, 26, .30), transparent 40%),
        linear-gradient(160deg, #1d2126 0%, #2b3036 55%, #3a3f46 100%);
    isolation: isolate;
}
.portal-split__visual::before {
    /* A faint survey grid, a nod to site plans. */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.portal-split__orbit { position: absolute; inset-inline-start: -140px; bottom: -140px; z-index: -1; }
.portal-split__orbit span {
    position: absolute;
    inset: 0;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
}
.portal-split__orbit span:nth-child(2) { inset: 60px; width: 300px; height: 300px; border-color: rgba(240, 122, 26, .35); }
.portal-split__orbit span:nth-child(3) { inset: 120px; width: 180px; height: 180px; border-style: dashed; }

.portal-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.portal-brand:hover { color: #fff; }
.portal-brand img { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }
.portal-brand strong { display: block; font-size: 1rem; font-weight: 850; }
.portal-brand small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .72); font-size: .78rem; }

.portal-split__copy { margin-top: 2vh; max-width: 560px; }
.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--pl-amber);
    font-size: .78rem;
    font-weight: 800;
}
.portal-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pl-orange); box-shadow: 0 0 0 4px rgba(240, 122, 26, .25); }
.portal-split__copy h1 {
    margin: 18px 0 14px;
    color: #fff;
    font-size: clamp(1.9rem, 3.2vw, 2.85rem);
    font-weight: 900;
    line-height: 1.45;
}
.portal-split__copy h1 em {
    /* A solid colour, not a clipped gradient: background-clip:text cut the tails of letters such as «ع». */
    font-style: normal;
    color: #ff9a3c;
    white-space: nowrap;
}
.portal-split__copy p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 1rem; line-height: 2; }

.portal-path {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 600px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.portal-path li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(30, 34, 39, .62);
    backdrop-filter: blur(6px);
}
.portal-path b {
    display: grid;
    flex: 0 0 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--pl-amber), var(--pl-orange-deep));
    font-size: .95rem;
    font-weight: 900;
}
.portal-path strong { display: block; font-size: .86rem; font-weight: 850; }
.portal-path small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .66); font-size: .72rem; }


/* ---------- Form side ---------- */
.portal-split__form {
    display: grid;
    place-items: center;
    padding: 40px clamp(20px, 4vw, 56px);
    background:
        radial-gradient(circle at 20% 10%, rgba(240, 122, 26, .08), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(43, 48, 54, .07), transparent 45%),
        #f3f2f0;
}
.portal-login .portal-split__form .public-b-auth-card {
    width: 100%;
    max-width: 440px !important;
    min-height: 0 !important;
    border: 1px solid #e4e1dc;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(34, 39, 45, .12), 0 2px 6px rgba(34, 39, 45, .05);
}

/* Two-step indicator in place of the tabs: phone number, then code. */
.portal-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 22px 26px 0;
    list-style: none;
}
.portal-steps li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    color: #8b8f95;
    font-size: .8rem;
    font-weight: 800;
}
.portal-steps li::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 4px;
    border-radius: 4px;
    background: #e7e4df;
}
.portal-steps b {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #eeebe6;
    font-size: .74rem;
}
.portal-steps li.is-active { color: var(--pl-ink); }
.portal-steps li.is-active b { background: var(--pl-orange); color: #fff; }
.portal-steps li.is-active::after { background: linear-gradient(90deg, var(--pl-amber), var(--pl-orange-deep)); }
.portal-steps li.is-done b { background: var(--pl-graphite); color: #fff; }

.portal-login .public-b-auth-body { padding: 22px 26px 24px; }
.portal-login .public-b-auth-title h2 { color: var(--pl-ink); }
.portal-login .public-b-primary-action {
    min-height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f58a2a, var(--pl-orange-deep));
    box-shadow: 0 12px 26px rgba(217, 88, 12, .25);
    font-size: .88rem;
}
.portal-login .public-b-primary-action:hover { filter: brightness(1.05); color: #fff; }
.portal-login .public-b-auth-card .form-control { border-radius: 12px; border-color: #dcd8d2; }
.portal-login .public-b-auth-card .form-control:focus { border-color: var(--pl-orange) !important; box-shadow: 0 0 0 4px rgba(240, 122, 26, .16) !important; outline: 0 !important; }
.portal-login .public-b-auth-card .btn-link { color: var(--pl-orange-deep); }
.portal-login #loginOtp { letter-spacing: .6em; font-size: 1.25rem; font-weight: 800; }
.portal-login .login-register-callout span + span { color: var(--pl-orange-deep); font-weight: 800; }
.public-b-login-page .alert[hidden] { display: none; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 991.98px) {
    .portal-split { grid-template-columns: 1fr; }
    .portal-split__visual { gap: 16px; padding: 22px 20px 150px; background-size: 150% auto, auto, auto; background-position: 62% bottom, center, center; }
    .portal-split__copy { margin-top: 0; }
    .portal-split__copy h1 { margin: 12px 0 8px; font-size: 1.5rem; }
    .portal-split__copy p { font-size: .88rem; line-height: 1.9; }
    .portal-path { display: none; }
    .portal-split__form { place-items: start center; padding: 0 16px 28px; background: #f3f2f0; }
    .portal-login .portal-split__form .public-b-auth-card { margin-top: -54px; max-width: 520px !important; }
    /* On the code step the field comes first; the introduction is already read. */
    .portal-login:has(#otpVerifyForm) .portal-split__copy p { display: none; }
}
@media (max-width: 420px) {
    .portal-brand strong { font-size: .9rem; }
    .portal-steps { padding: 18px 18px 0; }
    .portal-login .public-b-auth-body { padding: 20px 18px 22px; }
}

/* ---------- Error page: the same card on the charcoal mine drawing. ---------- */
.public-b-page .error-card { max-width: 480px; margin: 0 auto; min-height: 0; }
.public-b-page .error-reference { margin: 16px 0 0; color: #6b7a90; font-size: .82rem; text-align: center; }
.public-b-page .error-reference bdi { margin-inline-start: 6px; font-family: monospace; }
.public-b-error-page .public-b-hero {
    min-height: calc(100vh - 72px);
    min-height: calc(100dvh - 72px);
    background: url("/images/login-schematic.svg") center bottom / min(100%, 1100px) auto no-repeat, linear-gradient(160deg, #1d2126, #3a3f46);
}
.public-b-error-page .public-b-hero::before, .public-b-error-page .public-b-hero::after { display: none; }
.public-b-error-page .public-b-primary-action { background: linear-gradient(135deg, #f58a2a, #d9580c); }
.public-b-error-page .public-b-btn--ghost { border-color: #f3c49a; color: #d9580c; }
.public-b-error-page .public-b-brand__tagline { color: #d9580c; }
