/* ------------------------------------------------------------------
   Registration pages (employee + citizen) — mockup-aligned design.
   Theme-aware: colours come from var(--nav-bg) so it matches the mockup's
   teal/green on the default theme and adapts to the other themes.
   CSP-nonce safe: external stylesheet, no inline styles.
   Presentational only — form fields, bindings and JS are unchanged.
------------------------------------------------------------------ */

/* ===== Top tab bar ===== */
.reg-tabbar {
    display: flex;
    max-width: 920px;
    margin: 0 auto;
    background: var(--nav-bg, #095a6f);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.reg-tab {
    flex: 1;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);   /* raised from 0.6 for WCAG contrast */
    text-align: center;
    letter-spacing: 0.02em;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.reg-tab:last-child {
    border-right: none;
}

.reg-tab.active {
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 82%, #fff);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--nav-bg, #095a6f) 45%, #fff);
}

/* ===== Container ===== */
.reg-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 22px 4px 8px;
}

/* ===== Step header (emblem + title) ===== */
.reg-step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.reg-emblem {
    width: 60px;
    height: 60px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 20%, #fff);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.reg-emblem img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.reg-step-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    letter-spacing: 0.02em;
    text-align: center;
}

.reg-divider {
    height: 1px;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 18%, #fff);
    margin-bottom: 20px;
}

/* ===== Progress bar (circles + connecting lines) ===== */
.reg-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 24px;
}

.reg-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.reg-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 14%, #fff);
    border: 2px solid color-mix(in srgb, var(--nav-bg, #095a6f) 30%, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 78%, #000);
}

.reg-circle.active {
    background: var(--nav-bg, #095a6f);
    border-color: var(--nav-bg, #095a6f);
    color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-bg, #095a6f) 20%, transparent);
}

.reg-circle.done {
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 80%, #fff);
    border-color: color-mix(in srgb, var(--nav-bg, #095a6f) 80%, #fff);
    color: #fff;
}

.reg-node-label {
    font-size: 10.5px;
    color: #475569;   /* darker for WCAG contrast on the light page */
    font-weight: 500;
    white-space: nowrap;
}

.reg-node-label.active {
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 85%, #000);   /* darkened so it passes on light bg in every theme */
    font-weight: 600;
}

.reg-line {
    width: 80px;
    height: 2px;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 14%, #fff);
    margin: 16px 6px 0;
}

.reg-line.done {
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 80%, #fff);
}

/* ===== Card ===== */
.reg-card {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 15%, #fff);
    border-radius: 10px;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--nav-bg, #095a6f) 8%, transparent);
    padding: 26px 28px 22px;
}

.reg-section-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reg-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 15%, #fff);
}

/* ===== Form grid ===== */
.reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.reg-field {
    display: flex;
    flex-direction: column;
}

.reg-field.full {
    grid-column: 1 / -1;
}

.reg-field label {
    font-size: 12px;
    font-weight: 600;
    color: #2d3a48;
    margin-bottom: 5px;
    text-align: left;
    display: block;
}

.reg-field label .req {
    color: #b91c1c;
    margin-left: 2px;
}

/* Inputs / selects — themed. 48px matches the view's text-input height rule. */
.reg-field .form-control,
.reg-field select.form-control {
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 22%, #fff);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 3%, #fff);
    color: #1a1a1a;
    width: 100%;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.reg-field .form-control:focus,
.reg-field select.form-control:focus {
    border-color: var(--nav-bg, #095a6f);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-bg, #095a6f) 14%, transparent);
    outline: none;
}

/* Password input-group with the show/hide toggle (kept from the view's JS) */
.reg-field .input-group {
    position: relative;
    display: flex;
    width: 100%;
}

.reg-field .input-group .form-control {
    border-radius: 8px;
    padding-right: 44px;
}

.reg-field .input-group .toggle-password {
    position: absolute;
    right: 4px;
    top: 0;
    height: 100%;
    width: 38px;
    border: none;
    background: transparent;
    color: var(--nav-bg, #095a6f);
    cursor: pointer;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.reg-field .input-group .toggle-password:hover,
.reg-field .input-group .toggle-password:focus-visible {
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 80%, #000);
    outline: none;
}

/* ===== Password hint ===== */
.reg-pw-hint {
    grid-column: 1 / -1;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 5%, #fff);
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 18%, #fff);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11.5px;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 78%, #000);
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.reg-pw-hint i {
    color: var(--nav-bg, #095a6f);
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 15px;
}

/* ===== Actions ===== */
.reg-login-link {
    text-align: center;
    font-size: 12px;
    color: #5e666d;
    margin: 16px 0 4px;
}

.reg-login-link a {
    color: #b91c1c;
    font-weight: 600;
    text-decoration: none;
}

.reg-login-link a:hover {
    text-decoration: underline;
}

.reg-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.reg-btn-primary {
    height: 42px;
    padding: 0 30px;
    background: var(--nav-bg, #095a6f);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--nav-bg, #095a6f) 25%, transparent);
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.reg-btn-primary:hover,
.reg-btn-primary:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    color: #fff !important;
    outline: none;
}

.reg-btn-back {
    height: 42px;
    padding: 0 22px;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 30%, #fff);
    border-radius: 8px;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 82%, #000);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.reg-btn-back:hover {
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 6%, #fff);
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .reg-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .reg-card {
        padding: 20px 16px;
    }

    .reg-line {
        width: 44px;
    }

    .reg-node-label {
        font-size: 9.5px;
    }

    .reg-tab {
        font-size: 11.5px;
        padding: 10px 8px;
    }
}

@media (max-width: 420px) {
    .reg-line {
        width: 26px;
        margin: 16px 4px 0;
    }

    .reg-node-label {
        font-size: 8.5px;
    }

    .reg-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* ==================================================================
   VERIFY OTP page — 6-box code entry (theme-aware).
   ================================================================== */
.otp-wrap {
    max-width: 660px;
}

.otp-card {
    text-align: center;
}

.otp-section h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    margin: 0 0 4px;
}

.otp-section p {
    font-size: 12.5px;
    color: #5e666d;
    line-height: 1.6;
    margin: 0 auto 20px;
    max-width: 430px;
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
}

.otp-digit {
    width: 48px;
    height: 54px;
    border: 1.5px solid color-mix(in srgb, var(--nav-bg, #095a6f) 22%, #fff);
    border-radius: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 3%, #fff);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.otp-digit:focus {
    border-color: var(--nav-bg, #095a6f);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-bg, #095a6f) 14%, transparent);
}

.otp-resend {
    font-size: 12.5px;
    color: #5e666d;
    margin-top: 10px;
}

.otp-resend a {
    color: var(--nav-bg, #095a6f);
    font-weight: 600;
    text-decoration: none;
}

.otp-resend a:hover {
    text-decoration: underline;
}

.otp-timer {
    color: #b91c1c;
    font-weight: 600;
}

@media (max-width: 480px) {
    .otp-inputs {
        gap: 6px;
    }

    .otp-digit {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }
}

/* ==================================================================
   CITIZEN REGISTRATION — two-panel card (avatar left + form right).
   Theme-aware via var(--nav-bg). CSP-safe external styles.
   ================================================================== */
.creg-wrap {
    padding: 32px 16px;
    display: flex;
    justify-content: center;
}

.creg-card {
    display: flex;
    width: 100%;
    max-width: 860px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 15%, #fff);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--nav-bg, #095a6f) 12%, transparent);
}

/* Left brand panel */
.creg-left {
    width: 250px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 6%, #fff);
    border-right: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 12%, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    gap: 18px;
    text-align: center;
}

.creg-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 16%, #fff);
    border: 3px solid var(--nav-bg, #095a6f);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creg-avatar .mdi {
    font-size: 82px;
    line-height: 1;
    color: var(--nav-bg, #095a6f);
}

.creg-left-divider {
    width: 40px;
    height: 2px;
    background: var(--nav-bg, #095a6f);
    border-radius: 2px;
    opacity: 0.35;
}

.creg-left-title h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    margin: 0 0 4px;
}

.creg-left-title p {
    font-size: 11px;
    color: #5e666d;
    line-height: 1.5;
    margin: 0;
}

/* Right form panel */
.creg-right {
    flex: 1;
    padding: 26px 28px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.creg-header {
    margin-bottom: 18px;
}

.creg-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--nav-bg, #095a6f);
    margin: 0 0 3px;
}

.creg-header p {
    font-size: 12px;
    color: #5e666d;
    margin: 0;
}

.creg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.creg-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.creg-field.full {
    grid-column: 1 / -1;
}

.creg-field label {
    font-size: 12px;
    font-weight: 600;
    color: #2d3a48;
    margin-bottom: 5px;
    text-align: left;
}

.creg-field label .star {
    color: #b91c1c;
    margin-left: 2px;
}

.creg-field .form-control {
    height: 44px;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 22%, #fff);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 3%, #fff);
    color: #1a1a1a;
    width: 100%;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.creg-field .form-control:focus {
    border-color: var(--nav-bg, #095a6f);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-bg, #095a6f) 14%, transparent);
    outline: none;
}

.creg-input-wrap {
    position: relative;
}

.creg-input-wrap .form-control {
    padding-right: 42px;
}

.creg-input-wrap .toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--nav-bg, #095a6f);
    cursor: pointer;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.creg-input-wrap .toggle-password:focus-visible {
    outline: 2px solid var(--nav-bg, #095a6f);
    outline-offset: 2px;
    border-radius: 6px;
}

.creg-hint {
    grid-column: 1 / -1;
    font-size: 11px;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 78%, #000);
    line-height: 1.6;
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 5%, #fff);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--nav-bg, #095a6f);
    margin-top: 4px;
    text-align: left;
}

.creg-hint span {
    font-weight: 700;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 82%, #000);
}

/* Password strength bar (kept from the view) */
.pw-bar {
    display: flex;
    gap: 4px;
    margin: 8px 0 0;
}

.pw-bar span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e5e7eb;
}

.pw-bar span.s1 { background: #d43b3a; }
.pw-bar span.s2 { background: #d9861a; }
.pw-bar span.s3 { background: #157f5d; }

.creg-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.creg-btn-cancel {
    height: 44px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 28%, #fff);
    border-radius: 8px;
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 82%, #000);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.creg-btn-cancel:hover,
.creg-btn-cancel:focus-visible {
    background: color-mix(in srgb, var(--nav-bg, #095a6f) 6%, #fff);
    color: color-mix(in srgb, var(--nav-bg, #095a6f) 82%, #000);
    outline: none;
}

.creg-btn-primary {
    flex: 1;
    height: 44px;
    background: var(--nav-bg, #095a6f);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--nav-bg, #095a6f) 25%, transparent);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.creg-btn-primary:hover,
.creg-btn-primary:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    color: #fff !important;
    outline: none;
}

.creg-login-link {
    text-align: center;
    font-size: 12.5px;
    color: #5e666d;
    margin-top: 14px;
}

.creg-login-link a {
    color: var(--nav-bg, #095a6f);
    font-weight: 600;
    text-decoration: none;
}

.creg-login-link a:hover {
    text-decoration: underline;
}

.creg-field .fld-err,
.creg-field .text-danger {
    font-size: 12px;
    margin-top: 4px;
    color: #b91c1c;   /* GIGW AA contrast on white */
}

/* Responsive: stack the two panels */
@media (max-width: 700px) {
    .creg-card {
        flex-direction: column;
    }

    .creg-left {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 14px;
        padding: 16px 18px;
        border-right: none;
        border-bottom: 1px solid color-mix(in srgb, var(--nav-bg, #095a6f) 12%, #fff);
    }

    .creg-avatar {
        width: 66px;
        height: 66px;
    }

    .creg-avatar .mdi {
        font-size: 48px;
    }

    .creg-left-divider {
        display: none;
    }

    .creg-left-title {
        text-align: left;
    }

    .creg-grid {
        grid-template-columns: 1fr;
    }

    .creg-right {
        padding: 20px 18px;
    }
}

