                                    
                                                                    
                                                                              
                                                       

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
    background: linear-gradient(180deg, #eff6ff 0%, var(--bg-main) 100%);
}

.auth-shell {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.auth-back {
    position: absolute;
    top: -44px;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 8px 6px 2px;
    border-radius: 6px;
    transition: color 0.15s;
}

.auth-back:hover {
    color: var(--primary);
    text-decoration: none;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px 24px;
    box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.12);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-brand img {
    border-radius: 10px;
    flex-shrink: 0;
}

.auth-side-copy {
    display: none;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--primary);
    margin: 0 0 2px;
}

.auth-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

                                 
.auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.auth-alert.auth-alert-success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.auth-alert.auth-alert-error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

                                
.auth-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

                                
.auth-fieldset {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.auth-fieldset:disabled {
    pointer-events: none;
    user-select: none;
}

.auth-form.is-submitting {
    pointer-events: none;
    user-select: none;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .form-group label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 7px;
    display: block;
}

.form-group label .opt {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.85;
}

.req {
    color: #ef4444;
    font-weight: 700;
    margin-left: 2px;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.form-row {
    display: grid;
    gap: 16px;
}

.form-row .form-group {
    margin-bottom: 18px;
}

.field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.field {
    resize: vertical;
    min-height: 56px;
}

.field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 100, 242, 0.15);
}

.field:disabled,
select.field:disabled,
textarea.field:disabled {
    background-color: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.75;
}

.checkbox-label:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-group-consent .checkbox-label:has(#reg-agree:disabled) {
    opacity: 1;
    cursor: default;
}

.field.field-invalid {
    border-color: var(--danger);
}

.field.field-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 6px 2px 0;
    min-height: 1em;
}

.field-hint.field-hint-error {
    color: var(--danger);
    font-weight: 500;
}

                                
.password-wrap {
    position: relative;
}

.password-wrap .field {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.password-toggle:hover {
    color: var(--primary);
    background: #eff6ff;
}

.password-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

                                                                            
.password-rules {
    list-style: none;
    margin: 8px 2px 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.password-rules.is-visible {
    display: flex;
}

.password-rules li {
    position: relative;
    padding-left: 22px;
    font-size: 0.78rem;
    color: var(--danger, #dc2626);
    transition: color 0.15s;
}

.password-rules li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--danger, #dc2626);
    background: #fef2f2;
}

.password-rules.all-ok {
    display: none;
    margin: 0;
}

.password-rules li.rule-ok {
    display: none;
}

                                  
.auth-submit {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-top: 4px;
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

                                    
.auth-footnote {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 20px 0 0;
}

                                           
.auth-forgot {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-forgot:hover {
    text-decoration: underline;
}

.auth-back-row {
    margin-bottom: 18px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-back-link:hover {
    color: var(--primary);
}

                                                            
.reset-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.reset-backdrop.is-open {
    display: flex;
}

.reset-modal {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 28px 24px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.reset-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.reset-close:hover {
    color: var(--text-main);
    background: var(--border);
}

.reset-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 4px;
    text-align: center;
}

.reset-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 20px;
    text-align: center;
    word-break: break-all;
}

.reset-body {
    display: flex;
    flex-direction: column;
}

.reset-pin-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 4px 0 16px;
}

.reset-pin-input {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    outline: none;
    color: var(--text-main);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.reset-pin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 100, 242, 0.18);
}

.reset-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.reset-resend {
    background: none;
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.reset-resend:hover:not(:disabled) {
    background: #eff6ff;
}

.reset-resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-submit {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.reset-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 6px 2px 0;
}

.reset-hint.field-hint-error {
    color: var(--danger);
    font-weight: 500;
}

.reset-error {
    font-size: 0.82rem;
    color: var(--danger);
    min-height: 1.2em;
    margin: 12px 0 0;
    text-align: center;
}

                                                                                       

                                                    
.reg-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 24px 18px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: #eff6ff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.reg-dropzone:hover,
.reg-dropzone.is-dragover {
    border-color: var(--primary);
    background: #eaf3ff;
}

.reg-dropzone.is-error {
    border-color: var(--danger);
    background: #fef2f2;
}

.reg-dropzone-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
}

.reg-dropzone-text {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}

.reg-dropzone-text .browse {
    color: var(--primary);
    font-weight: 700;
}

.reg-dropzone-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.reg-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

                                                 
.reg-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    margin-top: 10px;
}

.reg-preview-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: #f1f5f9;
}

.reg-preview-thumb.is-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    background: #fef2f2;
}

.reg-preview-meta {
    flex: 1;
    min-width: 0;
}

.reg-preview-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-main);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.reg-preview-size {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.reg-preview-ok {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--success);
    margin-top: 4px;
}

.reg-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.reg-remove:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: #fef2f2;
}

.reg-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.reg-remove svg {
    width: 16px;
    height: 16px;
}

.reg-dropzone.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: #f1f5f9;
}

.reg-preview.is-disabled {
    opacity: 0.75;
}

#reg-birthdate-calendar.is-disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.form-group-consent .checkbox-label .checkbox-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-group-consent .checkbox-label .checkbox-text a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.registration-policy-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(760px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface, #fff);
    color: var(--text-main, #111827);
    box-shadow: 0 24px 72px rgb(15 23 42 / 28%);
}

.registration-policy-modal::backdrop {
    background: rgb(15 23 42 / 64%);
}

.registration-policy-modal-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: clamp(16px, 3vw, 24px);
}

.registration-policy-modal-header,
.registration-policy-modal-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.registration-policy-modal-header h2 {
    margin: 0;
    color: var(--text-main, #111827);
    font-size: 1.2rem;
}

.registration-policy-modal-header {
    flex: 0 0 auto;
}

.registration-policy-scroll-hint {
    flex: 0 0 auto;
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    line-height: 1.4;
}

.registration-policy-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 16px 16px;
}

.registration-policy-content > .legal-meta:first-child {
    margin-top: 14px;
}

.registration-policy-modal-actions {
    flex-wrap: wrap;
}

#registration-policy-agree:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.registration-policy-fallback {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .registration-policy-modal {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }

    .registration-policy-modal-shell {
        padding: 12px;
    }

    .registration-policy-content {
        padding: 0 12px 12px;
    }

    .registration-policy-modal-actions .btn {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .auth-body {
        align-items: flex-start;
    }

    .auth-shell {
        max-width: 1080px;
        margin-block: auto;
    }

    .auth-back {
        top: -24px;
    }

    .auth-card {
        --auth-side-bg: #edf4fc;
        --auth-side-ink: #173b67;
        --auth-side-muted: #526174;
        position: relative;
        display: grid;
        grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "brand alert"
            "brand tabs"
            "sidecopy form"
            "sidecopy footnote";
        height: min(720px, calc(100vh - 64px));
        min-height: 600px;
        padding: 0;
        overflow: visible;
        border-radius: 18px;
        box-shadow: 0 20px 48px -24px rgba(23, 59, 103, 0.28);
    }

    [data-theme="dark"] .auth-card {
        --auth-side-bg: #172b49;
        --auth-side-ink: #e2e8f0;
        --auth-side-muted: #cbd5e1;
    }

    .auth-card::before {
        grid-column: 1;
        grid-row: 1 / -1;
        background: var(--auth-side-bg);
        border-radius: 18px 0 0 18px;
        content: "";
    }

    .auth-brand {
        grid-area: brand;
        align-self: start;
        gap: 16px;
        min-width: 0;
        margin: 0;
        padding: 42px 34px 18px;
        position: relative;
        z-index: 1;
    }

    .auth-brand img {
        display: none;
        width: 64px;
        height: 64px;
        padding: 6px;
        border-radius: 14px;
        background: #fff;
        object-fit: contain;
    }

    .auth-title {
        color: var(--auth-side-ink);
        font-size: 1.45rem;
        line-height: 1.15;
    }

    .auth-sub {
        max-width: none;
        color: var(--auth-side-muted);
        font-size: 0.86rem;
        line-height: 1.5;
    }

    .auth-side-copy {
        grid-area: sidecopy;
        display: block;
        align-self: center;
        min-width: 0;
        padding: 32px 36px 48px;
        position: relative;
        z-index: 1;
    }

    .auth-side-copy::before {
        content: "";
        display: block;
        width: clamp(120px, 18vh, 168px);
        aspect-ratio: 1;
        margin: 0 auto 22px;
        border: 1px solid rgba(23, 59, 103, 0.1);
        border-radius: 50%;
        background-color: #fff;
        background-image: url("../../../assets/pembologo.png");
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        box-shadow: 0 12px 28px -20px rgba(23, 59, 103, 0.4);
    }

    .auth-side-copy h2 {
        max-width: 13ch;
        margin: 0 0 14px;
        color: var(--auth-side-ink);
        font-size: clamp(2rem, 3vw, 2.45rem);
        font-weight: 700;
        letter-spacing: -0.035em;
        line-height: 1.08;
    }

    .auth-side-copy p {
        max-width: 34ch;
        margin: 0;
        color: var(--auth-side-muted);
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .auth-alert {
        grid-area: alert;
        justify-self: center;
        width: min(450px, calc(100% - 80px));
        margin: 32px 0 0;
    }

    .auth-tabs {
        grid-area: tabs;
        align-self: end;
        justify-self: center;
        width: min(450px, calc(100% - 80px));
        margin: 28px 0 24px;
    }

    .auth-panel {
        grid-area: form;
        align-self: stretch;
        justify-self: center;
        width: min(450px, calc(100% - 80px));
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 20px 16px 24px;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .auth-footnote {
        grid-area: footnote;
        justify-self: center;
        width: min(450px, calc(100% - 80px));
        margin: 10px 0 32px;
        text-align: center;
    }
}

