/**
 * The sign-up form's two-step chrome.
 *
 * The rows themselves are styled by the form's own stylesheet; everything here
 * is the frame around them -- the progress header, the review strip, the
 * footer, the password meter -- plus the one rule that does the stepping.
 *
 * @package    local_nzeruhub
 * @copyright  2026 UNDP Malawi IDT4M
 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* --- The stepping itself -------------------------------------------------
   One rule. A row belongs to a step, the form says which step it is on, and
   anything from the other step is out of the layout entirely -- not merely
   invisible, because a hidden row in a flex column still takes its gap. */
form[data-nh-wizard-step="1"] [data-nh-step="2"],
form[data-nh-wizard-step="2"] [data-nh-step="1"] {
    display: none !important;
}

/* THE SUBMIT ROW NEEDS ITS OWN RULE, AND THE REASON IS SPECIFICITY.
   The dialog's stylesheet lays that row out through `.nh-authpane__slot
   #fgroup_id_buttonar`, which carries an id and therefore outranks the
   attribute selector above -- !important on both sides does not change which
   is more specific. So "Create my account" stayed on screen through step one,
   next to Continue, offering to submit a form that was half answered. Matching
   it by id too puts this ahead. */
form[data-nh-wizard-step="1"] #fgroup_id_buttonar {
    display: none !important;
}

/* Core's password policy sentence. The chips under the box say the same thing
   and tick themselves off, so the sentence is redundant on screen -- but it is
   core's row and a screen reader may still be reading it, so it is taken out
   of sight rather than out of the page. */
.nh-wiz__policyhidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Where the wizard's own furniture sits -------------------------------
   THE FORM IS A FLEX COLUMN AND ITS ROWS CARRY AN `order`.

   conditionalfields.js numbers the four profile questions 11 to 14 so they
   read as a sequence. Anything without an order defaults to 0 and therefore
   sorts in FRONT of them -- which is where the Back button first appeared:
   above Country, halfway up the dialog, nowhere near the submit it belongs
   with. So the header, the review strip and the footer are numbered too. */
.nh-wiz__head {
    order: -20;
}

.nh-wiz__review {
    order: -10;
}

.nh-wiz__foot {
    order: 100;
}

/* And the real submit directly under the wizard's own buttons, so "Back" and
   "Create my account" read as the pair they are. */
form[data-nh-wizard-step] #fgroup_id_buttonar {
    order: 101;
}

/* --- Progress header ----------------------------------------------------- */
.nh-wiz__head {
    margin: 0 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--nh-border, #E2E7EF);
}

.nh-wiz__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.nh-wiz__step {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nh-blue-dark, #004a99);
}

/* The percentage was removed from the header -- a step number says the same
   thing better, and the bar shows the proportion. The rule is gone with it. */

.nh-wiz__bar {
    height: 6px;
    border-radius: 999px;
    background: #E9EEF6;
    overflow: hidden;
}

.nh-wiz__bar i {
    display: block;
    height: 100%;
    width: 50%;
    border-radius: 999px;
    background: linear-gradient(90deg, #F2B233, #FFD27A);
    transition: width .35s cubic-bezier(.2, .7, .3, 1);
}

.nh-wiz__dots {
    display: flex;
    gap: 10px;
    margin-top: 11px;
}

.nh-wiz__dot {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    color: var(--nh-ink-faint, #7d879c);
}

.nh-wiz__dot > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nh-wiz__n {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E9EEF6;
    color: var(--nh-ink-faint, #7d879c);
    font-size: 11.5px;
    font-weight: 700;
    transition: background .25s ease, color .25s ease;
}

.nh-wiz__dot.is-active {
    color: var(--nh-ink, #0B1B36);
    font-weight: 600;
}

.nh-wiz__dot.is-active .nh-wiz__n {
    background: var(--nh-ink, #14294F);
    color: #fff;
}

.nh-wiz__dot.is-done {
    color: #1E8A5F;
}

.nh-wiz__dot.is-done .nh-wiz__n {
    background: #1E8A5F;
    color: #fff;
}

/* --- Review strip on step two -------------------------------------------- */
.nh-wiz__review {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 10px 13px;
    border: 1px solid var(--nh-border, #E2E7EF);
    border-radius: 10px;
    background: var(--nh-surface-2, #F5F7FA);
    font-size: 13.5px;
    color: var(--nh-ink-faint, #5D6C86);
}

.nh-wiz__av {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--nh-ink, #14294F);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.nh-wiz__who {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nh-wiz__who b {
    color: var(--nh-ink, #16233B);
}

.nh-wiz__edit {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--nh-blue-dark, #2F4E7D);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 2px;
}

.nh-wiz__edit:hover {
    text-decoration: underline;
}

/* --- Footer -------------------------------------------------------------- */
.nh-wiz__foot {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.nh-wiz__btn {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.nh-wiz__btn--primary {
    flex: 1;
    background: var(--nh-ink, #14294F);
    color: #fff;
}

.nh-wiz__btn--primary:hover {
    background: var(--nh-blue-darker, #0B1B36);
}

.nh-wiz__btn--quiet {
    background: #fff;
    border: 1px solid var(--nh-border, #E2E7EF);
    color: var(--nh-ink, #14294F);
}

.nh-wiz__btn--quiet:hover {
    border-color: var(--nh-blue-dark, #2F4E7D);
    background: #F4F7FC;
}

/* On step two the real submit sits under Back, and the two read as one pair. */
form[data-nh-wizard-step="2"] #fgroup_id_buttonar {
    margin-top: 10px;
}

/* --- Password meter ------------------------------------------------------ */
.nh-pwmeter {
    margin-top: 8px;
}

.nh-pwmeter__track {
    height: 4px;
    border-radius: 999px;
    background: var(--nh-border, #E2E7EF);
    overflow: hidden;
}

.nh-pwmeter__fill {
    display: block;
    height: 100%;
    width: 0;
    background: #E08A7A;
    transition: width .25s ease, background .25s ease;
}

.nh-pwmeter[data-strength="part"] .nh-pwmeter__fill {
    background: #F2B233;
}

.nh-pwmeter[data-strength="full"] .nh-pwmeter__fill {
    background: #1E8A5F;
}

.nh-pwmeter__rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.nh-pwmeter__rule {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 7px;
    border: 1px solid var(--nh-border, #E2E7EF);
    border-radius: 999px;
    background: var(--nh-surface-2, #F5F7FA);
    font-size: 12px;
    color: var(--nh-ink-faint, #5D6C86);
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.nh-pwmeter__rule::before {
    content: "\25CB";
    font-size: 11px;
}

.nh-pwmeter__rule.is-met {
    color: #1E8A5F;
    background: #EAF6F0;
    border-color: #BFE3D1;
}

.nh-pwmeter__rule.is-met::before {
    content: "\2713";
    font-weight: 700;
}

/* --- A field the step would not accept ----------------------------------- */
.nh-wiz-invalid input,
.nh-wiz-invalid select,
.nh-wiz-invalid .nzeru-ss__input {
    border-color: #C0392B !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

.nh-wiz__err {
    margin: 5px 0 0;
    font-size: 12.5px;
    color: #C0392B;
}

@media (max-width: 540px) {
    .nh-wiz__dot > span:last-child {
        display: none;
    }

    .nh-wiz__dot {
        flex: 0 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nh-wiz__bar i,
    .nh-pwmeter__fill {
        transition: none;
    }
}
