/**
 * Стили модальных окон КриптоПро ЭЦП (выбор сертификата и пакетное подписание)
 */

.fg-cert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: fgCertFadeIn 0.2s ease-out;
}

@keyframes fgCertFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fg-cert-dialog {
    background-color: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 24px;
    box-sizing: border-box;
    animation: fgCertScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fg-cert-dialog--preloader {
    max-width: 440px;
}

.fg-cert-dialog--alert {
    max-width: 480px;
}

@keyframes fgCertScaleIn {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.fg-cert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.fg-cert-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: var(--black-900);
    margin: 0;
}

.fg-cert-close {
    background-color: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.fg-cert-close:hover {
    background-color: var(--black-100);
}

.fg-cert-close svg {
    width: 24px;
    height: 24px;
    color: var(--black-900);
    fill: currentColor;
    display: block;
}

.fg-cert-subtitle {
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    color: var(--black-900);
    margin-bottom: 16px;
}

.fg-cert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 2px;
}

.fg-cert-card {
    background-color: var(--black-50);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fg-cert-card:hover {
    background-color: var(--black-100);
}

.fg-cert-card:active {
    transform: scale(0.99);
}

.fg-cert-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fg-cert-card__name {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--black-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.fg-cert-card__date {
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: var(--black-800);
    white-space: nowrap;
}

.fg-cert-card__bottom {
    display: flex;
    align-items: center;
}

.fg-cert-card__fio {
    font-size: 10px;
    font-weight: 400;
    line-height: 14px;
    color: var(--black-600);
}

.fg-batch-dialog {
    max-width: 560px;
}

.fg-batch-cert-info {
    background-color: var(--black-50);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.fg-batch-cert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--black-900);
    flex-shrink: 0;
}

.fg-batch-cert-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.fg-batch-cert-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--black-900);
}

.fg-batch-cert-meta {
    font-size: 12px;
    color: var(--black-700);
    margin-top: 2px;
}

.fg-batch-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--black-800);
}

.fg-batch-progress-bar {
    height: 6px;
    background-color: var(--black-150);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.fg-batch-progress-fill {
    height: 100%;
    background-color: var(--green-600);
    transition: width 0.3s ease;
}

.fg-batch-docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 4px;
}

.fg-batch-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background-color: var(--black-50);
    border-radius: 8px;
}

.fg-batch-doc-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex: 1;
}

.fg-batch-doc-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--black-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fg-sign-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fg-sign-badge--waiting {
    background-color: var(--black-100);
    color: var(--black-700);
}

.fg-sign-badge--processing {
    background-color: var(--blue-50);
    color: var(--blue-600);
}

.fg-sign-badge--success {
    background-color: var(--green-50);
    color: var(--green-700);
}

.fg-sign-badge--error {
    background-color: var(--red-50);
    color: var(--red-600);
}

.fg-sign-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--blue-600);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: fgSpin 0.7s linear infinite;
}

.fg-preloader-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0 16px;
}

.fg-preloader-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--black-900);
}

.fg-alert-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--black-900);
    margin: 16px 0 24px;
}

.fg-alert-link {
    color: var(--green-600);
    text-decoration: underline;
}

.fg-alert-link:hover {
    color: var(--green-700);
}

.fg-cert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.fg-batch-doc-icon {
    width: 20px;
    height: 20px;
    color: var(--black-700);
    fill: currentColor;
    flex-shrink: 0;
}

.fg-badge-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.fg-badge-icon.fg-spin-icon {
    width: 14px;
    height: 14px;
}

.fg-spin-icon {
    display: inline-block;
    color: var(--green-600);
    width: 24px;
    height: 24px;
    fill: currentColor;
    animation: fgSpin 1.2s linear infinite;
    transform-origin: center;
    flex-shrink: 0;
}

.fg-d-none {
    display: none;
}

@keyframes fgSpin {
    to {
        transform: rotate(360deg);
    }
}

.fg-batch-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.fg-batch-msg {
    font-size: 12px;
    min-height: 18px;
}

.fg-batch-msg--info {
    color: var(--blue-600);
}

.fg-batch-msg--success {
    color: var(--green-700);
    font-weight: 500;
}

.fg-batch-msg--error {
    color: var(--red-600);
    font-weight: 500;
}

.fg-batch-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
