/* 03-wave / 04-open 共用表单。校验视觉对齐 UI Kit 的 .erp-field.is-error。 */

.auth {
    width: min(100%, 420px);
}

.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;
}

.auth h2 {
    margin-bottom: 22px;
}

.erp-field {
    margin: 0 0 14px;
}

.erp-field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.erp-field__label {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--label);
}

.erp-field__label--required::after {
    content: "*";
    margin-left: 4px;
    color: #E53935;
    font-weight: 700;
}

.opt {
    margin-left: 6px;
    font-weight: 400;
    color: var(--muted);
}

.forgot {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}

.forgot:hover { text-decoration: underline; }

.erp-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--input-text);
    font: inherit;
    font-size: 15px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.erp-input::placeholder { color: var(--placeholder); }

.erp-input:hover { border-color: var(--line-hover); }

.erp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.pass .erp-input { padding-right: 44px; }

.erp-field__error {
    display: none;
    align-items: flex-start;
    gap: 4px;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.45;
    color: #E53935;
}

.erp-field__error .err-ico {
    flex: 0 0 auto;
    margin-top: 1px;
}

.erp-field.is-error .erp-field__error { display: flex; }

.erp-field.is-error .erp-input,
.erp-field.is-error .otp input,
.erp-field.is-error .slider {
    border-color: #E53935;
}

.erp-field.is-error .erp-input:focus,
.erp-field.is-error .otp input:focus {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, .14);
}

.otp-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.otp-row input[type="hidden"] { display: none; }

.otp {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.otp input {
    width: 100%;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 18px;
    font-weight: 650;
    text-align: center;
    caret-color: var(--primary);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.otp input:hover { border-color: var(--line-hover); }

.otp input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.otp-row .code-btn {
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.otp-row .code-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: #fff;
    color: var(--primary);
}

.slider {
    position: relative;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #F4F7FB;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.slider__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: #E5F0FF;
}

.slider__text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 48px;
    color: var(--muted);
    font-size: 13px;
    pointer-events: none;
}

.slider__knob {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 40px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: grab;
    touch-action: none;
}

.slider__knob:active { cursor: grabbing; }

.slider__knob svg { display: block; margin: 0 auto; }

.slider.is-ok {
    border-color: #8FD9C4;
    background: #F3FBF8;
}

.slider.is-ok .slider__fill { background: #E5F7F1; }

.slider.is-ok .slider__text {
    color: #0E7A56;
    font-weight: 650;
}

.slider.is-ok .slider__knob {
    background: #1AA37A;
    cursor: default;
}

.extras { margin: -2px 0 16px; }

.agree {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 4px;
    color: var(--label);
    font-size: 13px;
    line-height: 1.55;
}

.erp-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    user-select: none;
}

.erp-check input {
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.text-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    text-decoration: none;
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

.text-link:hover { text-decoration: underline; }

.erp-field.is-error .agree { color: #E53935; }

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn--ghost {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn--ghost:hover { background: #F3F7FF; }

.auth .live:empty { display: none; }

.auth .live { min-height: 0; }

.doc {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(20, 40, 80, .18);
}

.doc::backdrop { background: rgba(16, 32, 58, .36); }

.doc__body { padding: 22px 22px 18px; }

.doc h3 {
    margin: 0 0 8px;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.doc p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.doc__foot {
    display: flex;
    justify-content: flex-end;
    padding: 0 22px 18px;
}

.doc__foot .btn {
    width: auto;
    min-width: 88px;
    height: 36px;
    padding: 0 16px;
}

.forgot:focus-visible,
.text-link:focus-visible,
.btn--ghost:focus-visible,
.slider__knob:focus-visible,
.otp input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .auth { width: 100%; }
    .erp-input,
    .otp input,
    .code-btn,
    .btn { font-size: 16px; }
    .otp { gap: 8px; }
    .otp input { height: 46px; border-radius: 8px; }
    .otp-row { flex-wrap: wrap; gap: 8px; }
    .otp { flex: 1 1 100%; }
    .otp-row .code-btn { width: 100%; height: 44px; }
    .agree { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .erp-input,
    .otp input,
    .slider__knob { transition: none; }
}
