/* Users app styling for authentication screens and access-management views. */
:root {
    --npdo-blue: #082a62;
    --npdo-blue-2: #004fae;
    --npdo-blue-soft: #5f7fbd;
    --npdo-border: #d8e4f5;
    --npdo-field-bg: #f8fbff;
    --npdo-shadow: 0 18px 46px rgba(13, 42, 84, 0.15);
}

.users-auth-body {
    background:
        radial-gradient(circle at 8% 14%, rgba(95, 127, 189, 0.16) 0 7px, transparent 8px),
        radial-gradient(circle at 92% 50%, rgba(95, 127, 189, 0.12) 0 8px, transparent 9px),
        radial-gradient(circle at 96% 86%, rgba(95, 127, 189, 0.16) 0 9px, transparent 10px),
        linear-gradient(135deg, rgba(226, 236, 250, 0.92), rgba(250, 252, 255, 0.98) 42%, rgba(229, 238, 250, 0.95));
}

.users-auth-body::before,
.users-auth-body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.users-auth-body::before {
    opacity: 0.32;
    background-image:
        linear-gradient(30deg, transparent 0 46%, rgba(160, 180, 216, 0.24) 47% 48%, transparent 49% 100%),
        linear-gradient(150deg, transparent 0 50%, rgba(160, 180, 216, 0.18) 51% 52%, transparent 53% 100%);
    background-size: 280px 220px, 340px 260px;
    background-position: left 40px top 20px, right 30px bottom 20px;
}

.users-auth-body::after {
    opacity: 0.30;
    background-image: radial-gradient(circle, rgba(95, 127, 189, 0.20) 0 2px, transparent 3px);
    background-size: 18px 18px;
    background-position: left 38px bottom 78px;
    mask-image: radial-gradient(circle at left bottom, #000 0 150px, transparent 210px);
}

.users-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.users-auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 22px;
}

.auth-page,
.users-page {
    width: 100%;
}

.auth-card,
.users-card {
    width: min(980px, calc(100% - 16px));
    margin: 0 auto;
    padding: 24px;
}

.auth-card {
    width: min(560px, 100%);
    padding: clamp(22px, 3vw, 34px) clamp(22px, 4vw, 38px);
    border: 1px solid rgba(219, 228, 238, 0.86);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--npdo-shadow);
    backdrop-filter: blur(8px);
}

.auth-card--register {
    width: min(660px, 100%);
    padding: clamp(18px, 2.4vw, 26px) clamp(20px, 3vw, 30px);
}

.auth-card--login {
    width: min(500px, 100%);
    padding-top: clamp(28px, 4vw, 38px);
    padding-bottom: clamp(28px, 4vw, 38px);
}

.auth-card__head {
    display: grid;
    justify-items: center;
    gap: 5px;
    margin-bottom: 14px;
    text-align: center;
}

.auth-card__logo {
    width: min(104px, 34vw);
    height: auto;
    object-fit: contain;
    margin-bottom: 4px;
}

.auth-card__logo--login {
    width: min(116px, 36vw);
    margin-bottom: 8px;
}

.auth-card__head h1 {
    margin: 0;
    color: var(--npdo-blue);
    font-size: clamp(1.45rem, 2.4vw, 1.78rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-card__head p,
.muted {
    max-width: 500px;
    margin: 0;
    color: var(--npdo-blue-soft);
    font-size: 0.88rem;
    line-height: 1.35;
}

.npdo-auth-form,
.npdo-form,
.users-search {
    display: grid;
    gap: 10px;
}

.auth-form-grid--two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.auth-form-grid--passwords .auth-help-text {
    grid-column: 1 / -1;
}

.auth-field label,
.form-row label,
.checkbox-row label {
    display: block;
    margin-bottom: 5px;
    color: #061a4a;
    font-weight: 800;
    font-size: 0.86rem;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auth-input-wrap {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid var(--npdo-border);
    border-radius: 9px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(8, 42, 98, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.auth-input-wrap:focus-within {
    border-color: #8fb0e6;
    box-shadow: 0 0 0 3px rgba(0, 79, 174, 0.10);
    background: #ffffff;
}

.auth-input-wrap--password {
    grid-template-columns: 40px minmax(0, 1fr) 38px;
}

.auth-input-icon,
.auth-input-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    color: #061a4a;
    background: var(--npdo-field-bg);
}

.auth-input-action {
    background: #ffffff;
    color: #365fa7;
}

.auth-input-icon svg,
.auth-input-action svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.npdo-auth-input,
.form-row input,
.form-row select,
.users-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: #ffffff;
    color: #061a4a;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
}

.npdo-auth-input {
    min-height: 40px;
    padding: 0 11px;
}

.auth-input-wrap--password .npdo-auth-input {
    padding-right: 4px;
}

.npdo-auth-input::placeholder {
    color: #5f7fbd;
    opacity: 1;
}

.auth-help-text {
    margin-top: 2px;
    color: #5f7fbd;
    font-size: 0.74rem;
    line-height: 1.28;
}

.auth-help-text ul {
    margin: 3px 0 0 16px;
    padding: 0;
}

.auth-help-text--compact ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 2px;
}

.auth-small-help,
.form-row small {
    display: block;
    margin-top: 4px;
    color: #5f7fbd;
    font-size: 0.76rem;
}

.form-error {
    margin-top: 4px;
    color: #b42318;
    font-size: 0.8rem;
    font-weight: 600;
}

.form-error--block {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff1f2;
}

.npdo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 9px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.npdo-btn:hover {
    transform: translateY(-1px);
}

.npdo-btn-primary {
    background: linear-gradient(180deg, #0059c9 0%, #003f99 42%, #082a62 100%);
    border-color: #004cae;
    color: #ffffff;
    box-shadow: 0 6px 12px rgba(0, 63, 153, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.npdo-btn-primary:hover {
    background: linear-gradient(180deg, #0063dd 0%, #004aa8 42%, #062454 100%);
    border-color: #00479f;
}

.auth-submit {
    width: 100%;
    min-height: 42px;
    margin-top: 2px;
    font-size: 0.94rem;
    border-radius: 9px;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    margin: 14px 0 10px;
    color: #5f7fbd;
    font-weight: 700;
    font-size: 0.88rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: #dbe6f7;
}

.auth-switch {
    margin: 0;
    color: #5f7fbd;
    text-align: center;
    font-size: 0.88rem;
}

.auth-switch a {
    color: #0068df;
    font-weight: 800;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Existing users management screens */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-row input,
.form-row select,
.users-search input {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
}

.form-row input:focus,
.form-row select:focus,
.users-search input:focus {
    outline: 2px solid rgba(15, 59, 113, 0.18);
    border-color: #0f3b71;
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkbox-row label {
    margin: 0;
}

.npdo-btn-small {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.85rem;
}

.users-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.users-search {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 16px;
}

.npdo-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
}

.npdo-table th,
.npdo-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.npdo-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.access-tile {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fafc;
}

.access-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.npdo-app-nav__empty {
    color: #64748b;
    font-weight: 600;
}

/* Auth pages keep the global NPDO header/nav/footer while preserving the modern card background. */
.users-auth-page {
    position: relative;
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 20px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(127deg, #e4e8ee 0%, #f8fafc 42%, #e6edf6 100%);
}

/* Keep the login/register card above the NPDO watermark. */
.users-auth-page>.auth-card {
    position: relative;
    z-index: 1;
}

.users-auth-page {
    position: relative;
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 20px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(127deg, #e4e8ee 0%, #f8fafc 42%, #e6edf6 100%);
}

/* Keep the login/register card above the background marks */
.users-auth-page>* {
    position: relative;
    z-index: 1;
}

/* Left NPDO O mark */
.users-auth-page::before,
.users-auth-page::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: min(30vw, 360px);
    height: min(30vw, 360px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.10;
    background-image: url("../img/npdo-o-mark.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 20px 40px rgba(8, 42, 98, 0.10));
}

/* Left side */
.users-auth-page::before {
    left: clamp(16px, 4vw, 72px);
}

/* Right side */
.users-auth-page::after {
    right: clamp(16px, 4vw, 72px);
}

@media (max-width: 760px) {
    .users-auth-main {
        align-items: flex-start;
        padding: 18px 12px 20px;
    }

    .users-auth-page {
        align-items: flex-start;
        min-height: calc(100vh - 190px);
        padding: 18px 12px 20px;
        overflow: visible;
    }

    .auth-card,
    .auth-card--register,
    .auth-card--login {
        width: min(100%, 520px);
        border-radius: 18px;
        padding: 22px 16px;
    }

    .auth-card__head {
        margin-bottom: 14px;
    }

    .auth-form-grid--two,
    .form-grid,
    .access-list,
    .users-search {
        grid-template-columns: 1fr;
    }

    .auth-help-text--compact ul {
        grid-template-columns: 1fr;
    }

    .auth-input-wrap,
    .auth-input-wrap--password {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .auth-input-wrap--password {
        grid-template-columns: 40px minmax(0, 1fr) 38px;
    }

    .npdo-auth-input {
        padding: 0 10px;
    }
}

@media (max-height: 760px) and (min-width: 761px) {
    .users-auth-page {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .auth-card--register {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .auth-card--register .auth-card__logo {
        width: 88px;
        margin-bottom: 2px;
    }

    .auth-card--register .auth-card__head {
        margin-bottom: 10px;
    }

    .auth-card--register .auth-card__head h1 {
        font-size: 1.42rem;
    }

    .auth-card--register .auth-card__head p {
        font-size: 0.82rem;
    }

    .auth-card--register .npdo-auth-form {
        gap: 8px;
    }

    .auth-card--register .auth-divider {
        margin: 10px 0 8px;
    }
}
/* Password visibility and guidance states for login/register forms. */
.auth-input-wrap--password {
    grid-template-columns: 40px minmax(0, 1fr) 42px;
}

.auth-input-wrap--password .npdo-auth-input {
    padding-right: 12px;
}

.auth-input-action {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 100%;
    border: 0;
    border-left: 1px solid #e3ecf8;
    padding: 0;
    cursor: pointer;
    color: #315b9f;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.auth-input-action::before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(0, 79, 174, 0.08);
    opacity: 0;
    transform: scale(0.78);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.auth-input-action:hover,
.auth-input-action:focus-visible {
    color: var(--npdo-blue-2);
    background: #f4f8ff;
}

.auth-input-action:hover::before,
.auth-input-action:focus-visible::before {
    opacity: 1;
    transform: scale(1);
}

.auth-input-action:focus-visible {
    outline: 3px solid rgba(0, 79, 174, 0.20);
    outline-offset: -3px;
}

.auth-input-action .auth-password-eye {
    position: relative;
    z-index: 1;
    display: block;
    width: 21px;
    height: 21px;
    overflow: visible;
    color: currentColor;
}

.auth-password-eye__outline,
.auth-password-eye__slash {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-password-eye__pupil {
    fill: currentColor;
    transform-origin: center;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.auth-password-eye__slash {
    opacity: 0;
    stroke-width: 2.2;
    stroke-dasharray: 22;
    stroke-dashoffset: 22;
    transition: opacity 0.14s ease, stroke-dashoffset 0.18s ease;
}

.auth-input-action.is-visible {
    color: #173f7c;
}

.auth-input-action.is-visible .auth-password-eye__pupil {
    transform: scale(0.82);
    opacity: 0.75;
}

.auth-input-action.is-visible .auth-password-eye__slash {
    opacity: 1;
    stroke-dashoffset: 0;
}

.auth-password-guidance {
    grid-column: 1 / -1;
    position: relative;
    overflow: hidden;
    margin-top: 2px;
    padding: 12px 13px;
    border: 1px solid #cfe0f7;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(241, 247, 255, 0.96));
    box-shadow: 0 8px 20px rgba(8, 42, 98, 0.06);
}

.auth-password-guidance::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #8fb0e6;
}

.auth-password-guidance__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-password-guidance__title {
    margin: 0;
    color: var(--npdo-blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.auth-password-guidance__subtitle {
    margin: 2px 0 0;
    color: #5f7fbd;
    font-size: 0.73rem;
    line-height: 1.3;
}

.auth-password-score {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid #cfe0f7;
    border-radius: 999px;
    background: #ffffff;
    color: var(--npdo-blue);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.auth-password-progress {
    height: 5px;
    overflow: hidden;
    margin: 0 0 9px;
    border-radius: 999px;
    background: #dbe6f7;
}

.auth-password-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5f7fbd, #047857);
    transition: width 0.18s ease;
}

.auth-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-password-rule {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    min-height: 24px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #5f7fbd;
    background: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    line-height: 1.28;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.auth-password-rule__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #eef4ff;
    color: #5f7fbd;
    font-size: 0.72rem;
    font-weight: 900;
}

.auth-password-rule.is-valid {
    color: #065f46;
    border-color: #86efac;
    background: #ecfdf5;
}

.auth-password-rule.is-valid .auth-password-rule__icon {
    background: #bbf7d0;
    color: #065f46;
}

.auth-password-rule.is-invalid {
    color: #9f1239;
    border-color: #fecdd3;
    background: #fff1f2;
}

.auth-password-rule.is-invalid .auth-password-rule__icon {
    background: #ffe4e6;
    color: #9f1239;
}

.auth-password-guidance[data-password-checklist-empty="true"] .auth-password-rule {
    color: #5f7fbd;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.44);
}

.auth-password-guidance[data-password-checklist-complete="true"] {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4, #f8fbff);
}

.auth-password-guidance[data-password-checklist-complete="true"]::before,
.auth-password-guidance[data-password-checklist-complete="true"] [data-password-progress-bar] {
    background: #16a34a;
}

.auth-password-guidance[data-password-checklist-complete="true"] .auth-password-score {
    border-color: #86efac;
    background: #ecfdf5;
    color: #065f46;
}

.auth-password-guidance__note,
.auth-password-match {
    display: block;
    margin: 6px 0 0;
    font-size: 0.74rem;
    line-height: 1.28;
}

.auth-password-guidance__note,
.auth-password-match.is-neutral {
    color: #5f7fbd;
}

.auth-password-match.is-valid {
    color: #047857;
    font-weight: 700;
}

.auth-password-match.is-invalid {
    color: #b42318;
    font-weight: 700;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hide browser-native password reveal controls so NPDO shows only one working eye button. */
.npdo-auth-input::-ms-reveal,
.npdo-auth-input::-ms-clear,
.npdo-auth-input::-webkit-credentials-auto-fill-button,
.npdo-auth-input::-webkit-password-decoration,
.npdo-auth-input::-webkit-password-reveal-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 760px) {
    .auth-password-guidance__head {
        display: grid;
        gap: 8px;
    }

    .auth-password-score {
        justify-self: start;
    }

    .auth-password-rules {
        grid-template-columns: 1fr;
    }
}
