.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.portal-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.portal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(6px);
}
.portal-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: min(94vh, 720px);
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 32px 64px -16px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(219, 234, 254, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.portal-modal.is-open .portal-modal-dialog {
    transform: translateY(0) scale(1);
}
.portal-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0.75rem;
    background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
    border-bottom: 1px solid #dbeafe;
    flex-shrink: 0;
}
.portal-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.portal-modal-sub {
    font-size: 0.6875rem;
    color: #64748b;
    margin: 0.25rem 0 0;
    line-height: 1.45;
}
.portal-modal-close {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.625rem;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
}
.portal-modal-close:hover {
    background: #fff;
    color: #0f172a;
}
.portal-modal-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem 0;
    flex-shrink: 0;
}
.portal-modal-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}
.portal-modal-tab.active {
    background: #eff6ff;
    color: #1d4ed8;
}
.portal-modal-body {
    padding: 1rem 1.5rem 1.5rem;
    overflow-y: auto;
}
.portal-modal-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    text-align: center;
}
.portal-modal-alert-error {
    background: #fef2f2;
    color: #b91c1c;
}
.portal-modal-alert-success {
    background: #f0fdf4;
    color: #15803d;
}
.portal-modal-form .field {
    margin-bottom: 0.875rem;
}
.portal-modal-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
}
.portal-modal-form input,
.portal-modal-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    font-size: 0.875rem;
    outline: none;
}
.portal-modal-form input:focus,
.portal-modal-form select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
.portal-modal-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}
.portal-modal-submit:hover:not(:disabled) {
    filter: brightness(1.05);
}
.portal-modal-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}
.portal-captcha-question {
    margin: 0.35rem 0 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: 0.02em;
}
.portal-captcha-input {
    max-width: 8rem;
    font-variant-numeric: tabular-nums;
}
body.portal-modal-open {
    overflow: hidden;
}
