/**
 * Member Portal Login & First-Time Access wizard.
 * Extends the existing .client-login-* shell (assets/themes/feez/css/style.css)
 * with the ESEA portal palette (navy #0b1f3a / primary #005bc8).
 */
.ma-shell {
    --ma-primary: #005bc8;
    --ma-primary-d: #0049a3;
    --ma-navy: #0b1f3a;
    --ma-primary-l: #e7f1ff;
    --ma-text: #0f172a;
    --ma-muted: #64748b;
    --ma-border: #d4dbe3;
    --ma-bg: #f5f7f9;
    --ma-danger: #b91c1c;
    --ma-ok: #15803d;
}

.ma-card {
    width: min(460px, 94vw);
}

/* Visible, accessible labels (the shared .client-login-label is sr-only). */
.ma-card .client-login-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 6px;
    padding: 0;
    clip: auto;
    overflow: visible;
    border: 0;
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--ma-text);
}

.ma-card .form-group {
    text-align: left;
    margin-bottom: 14px;
}

.ma-card .form-control {
    background: var(--ma-bg);
    border: 1px solid var(--ma-border);
    border-radius: 8px;
    padding: 11px 12px;
    height: auto;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ma-card .form-control:focus {
    border-color: var(--ma-primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .16);
}

/* Buttons (this page does not carry body.customers_login) */
body.member-access-page .ma-btn.btn-primary,
.ma-card .ma-btn.btn-primary {
    background: var(--ma-primary);
    border-color: var(--ma-primary);
    border-radius: 8px;
    padding: 11px 16px;
    font-weight: 600;
    letter-spacing: .01em;
    position: relative;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

body.member-access-page .ma-btn.btn-primary:hover,
.ma-card .ma-btn.btn-primary:hover {
    background: var(--ma-primary-d);
    border-color: var(--ma-primary-d);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 73, 163, .22);
}

.ma-btn:disabled,
.ma-btn.is-loading {
    opacity: .75;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Progress steps ---------- */
.ma-steps {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 6px 0 20px;
}

.ma-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 130px;
    color: var(--ma-muted);
    font-size: 12px;
    font-weight: 600;
    position: relative;
}

.ma-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: #e2e8f0;
}

.ma-step.is-done:not(:last-child)::after {
    background: var(--ma-primary);
}

.ma-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    color: var(--ma-muted);
    border: 2px solid #e2e8f0;
    font-size: 13px;
    z-index: 1;
    transition: all .25s ease;
}

.ma-step.is-active .ma-step-dot {
    background: var(--ma-primary);
    border-color: var(--ma-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 91, 200, .14);
}

.ma-step.is-done .ma-step-dot {
    background: var(--ma-primary-l);
    border-color: var(--ma-primary);
    color: var(--ma-primary);
}

.ma-step.is-active,
.ma-step.is-done {
    color: var(--ma-text);
}

.ma-step-label {
    white-space: nowrap;
}

/* ---------- Panels + transitions ---------- */
.ma-panel {
    display: none;
    text-align: left;
}

.ma-panel.is-active {
    display: block;
    animation: ma-fade-in .32s ease both;
}

@keyframes ma-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Status / messages ---------- */
.ma-status {
    display: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.ma-status.is-error {
    display: block;
    background: #fef2f2;
    color: var(--ma-danger);
    border: 1px solid #fecaca;
}

.ma-status.is-success {
    display: block;
    background: #f0fdf4;
    color: var(--ma-ok);
    border: 1px solid #bbf7d0;
}

.ma-legend {
    font-size: 14px;
    font-weight: 600;
    color: var(--ma-text);
    margin: 0 0 12px;
}

.ma-hint {
    font-size: 12px;
    color: var(--ma-muted);
    margin: -4px 0 14px;
}

.ma-softhint {
    font-size: 13px;
    color: #1e3a5f;
    background: var(--ma-primary-l);
    border: 1px solid #cfe0f7;
    border-radius: 8px;
    padding: 9px 12px;
    margin: 0 0 14px;
}

.ma-softhint a {
    color: var(--ma-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Channel choice cards ---------- */
#ma-channels {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.ma-channel {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1.5px solid var(--ma-border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ma-channel:hover {
    border-color: var(--ma-primary);
    background: #fafcff;
}

.ma-channel.is-selected {
    border-color: var(--ma-primary);
    background: var(--ma-primary-l);
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .1);
}

.ma-channel-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: var(--ma-primary-l);
    color: var(--ma-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.ma-channel-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 1;
}

.ma-channel-name {
    font-weight: 600;
    color: var(--ma-text);
    font-size: 14px;
}

.ma-channel-value {
    color: var(--ma-muted);
    font-size: 13px;
    letter-spacing: .04em;
}

.ma-channel-check {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--ma-border);
    position: relative;
    transition: all .18s ease;
}

.ma-channel.is-selected .ma-channel-check {
    border-color: var(--ma-primary);
    background: var(--ma-primary);
}

.ma-channel.is-selected .ma-channel-check::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---------- OTP inputs ---------- */
.ma-otp-sentto {
    font-size: 13px;
    color: var(--ma-muted);
    margin: -6px 0 14px;
}

.ma-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ma-otp-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--ma-text);
    background: var(--ma-bg);
    border: 1.5px solid var(--ma-border);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ma-otp-box:focus {
    outline: none;
    border-color: var(--ma-primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .16);
}

.ma-resend {
    color: var(--ma-primary);
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

.ma-resend:disabled {
    color: var(--ma-muted);
    cursor: default;
}

/* ---------- Password: toggle + strength ---------- */
.ma-pwd-wrap {
    position: relative;
}

.ma-pwd-wrap .form-control {
    padding-right: 42px;
}

.ma-pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ma-muted);
    cursor: pointer;
    border-radius: 6px;
}

.ma-pwd-toggle:hover {
    color: var(--ma-primary);
}

.ma-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.ma-strength-bar {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.ma-strength-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width .25s ease, background .25s ease;
}

.ma-strength[data-level="1"] .ma-strength-bar > span { width: 33%;  background: #ef4444; }
.ma-strength[data-level="2"] .ma-strength-bar > span { width: 66%;  background: #f59e0b; }
.ma-strength[data-level="3"] .ma-strength-bar > span { width: 100%; background: #16a34a; }

.ma-strength-label {
    font-size: 12px;
    font-weight: 600;
    min-width: 52px;
    color: var(--ma-muted);
}

.ma-strength[data-level="1"] .ma-strength-label { color: #ef4444; }
.ma-strength[data-level="2"] .ma-strength-label { color: #d97706; }
.ma-strength[data-level="3"] .ma-strength-label { color: #16a34a; }

/* ---------- Spinner (loading state) ---------- */
.ma-spinner {
    display: none;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
    animation: ma-spin .7s linear infinite;
}

.ma-btn.is-loading .ma-spinner {
    display: inline-block;
}

@keyframes ma-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Success ---------- */
.ma-success {
    text-align: center;
}

.ma-success-check svg circle {
    stroke: var(--ma-ok);
    stroke-width: 2;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: ma-draw .5s ease forwards;
}

.ma-success-check svg path {
    stroke: var(--ma-ok);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: ma-draw .4s .45s ease forwards;
}

@keyframes ma-draw {
    to { stroke-dashoffset: 0; }
}

.ma-success-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ma-text);
    margin: 14px 0 8px;
}

.ma-success-msg {
    color: var(--ma-muted);
    font-size: 14px;
    margin: 0 0 20px;
}

.ma-redirecting {
    font-size: 12px;
    color: var(--ma-muted);
    margin-top: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .ma-card {
        padding: 26px 22px 22px;
    }
    .ma-step-label {
        display: none;
    }
    .ma-step {
        flex: none;
        max-width: none;
    }
    .ma-otp-box {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ma-panel.is-active,
    .client-login-card,
    .ma-success-check svg circle,
    .ma-success-check svg path {
        animation: none !important;
    }
    .ma-btn,
    .ma-step-dot,
    .ma-channel {
        transition: none !important;
    }
}
