.operation-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 39, 0.65);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    z-index: 1050;
    padding: 2rem;
}

.operation-form-card {
    width: min(var(--operation-form-width, 520px), 100%);
    background: linear-gradient(150deg, #ffffff 0%, #f5f7fb 100%);
    border-radius: 18px;
    box-shadow: 0 32px 60px -32px rgba(16, 24, 40, 0.42);
    position: relative;
    overflow: hidden;
    transform-origin: center;
    animation: operation-form-flip-in 480ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    border: 1px solid rgba(15, 35, 63, 0.08);
}

.operation-form-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(28, 101, 204, 0.12), transparent 55%),
                radial-gradient(circle at 85% 15%, rgba(244, 166, 35, 0.15), transparent 58%);
    pointer-events: none;
}

.operation-form-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.9);
    mix-blend-mode: overlay;
    pointer-events: none;
}

.operation-form-header {
    display: flex;
    gap: 1rem;
    padding: 2.25rem 2.5rem 1.5rem;
    align-items: flex-start;
}

.operation-form-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(24, 64, 142, 0.14), rgba(24, 64, 142, 0.32));
    color: #13316b;
    flex-shrink: 0;
    font-size: 1.35rem;
    box-shadow: inset 0 6px 12px -8px rgba(12, 29, 58, 0.35);
}

.operation-form-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f1f3d;
    letter-spacing: 0.01em;
}

.operation-form-title p {
    margin: 0.5rem 0 0;
    color: #4b5565;
    font-size: 0.95rem;
    line-height: 1.5;
}

.operation-form-body {
    padding: 0 2.5rem 2rem;
    display: grid;
    gap: 1.5rem;
}

.operation-form-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.operation-form-body label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2a3d;
    letter-spacing: 0.01em;
}

.operation-form-body .form-control,
.operation-form-body .e-input-group,
.operation-form-body .e-dropdownlist {
    border-radius: 12px !important;
    border: 1.5px solid rgba(15, 35, 63, 0.12) !important;
    transition: border-color 180ms ease, box-shadow 180ms ease;
    min-height: 2.75rem;
}

.operation-form-body .form-control:focus,
.operation-form-body .e-input-group.e-input-focus,
.operation-form-body .e-dropdownlist.e-focus {
    border-color: rgba(28, 101, 204, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(28, 101, 204, 0.16) !important;
}

.operation-form-footer {
    border-top: 1px solid rgba(15, 35, 63, 0.08);
    padding: 1.5rem 2.5rem 2.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(248, 250, 252, 0.95));
}

.operation-form-btn {
    border-radius: 6px;
    font-weight: 600;
    padding: 0.65rem 1.75rem;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.operation-form-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.operation-form-btn.primary {
    background: var(--alliance-primary);
    color: #ffffff;
    box-shadow: 0 6px 16px -8px rgba(var(--alliance-primary-rgb), 0.5);
}

.operation-form-btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--alliance-primary-dark);
    box-shadow: 0 8px 20px -10px rgba(var(--alliance-primary-rgb), 0.6);
}

.operation-form-btn.secondary {
    background: var(--color-background-primary);
    color: var(--alliance-text-secondary);
    border: 1px solid var(--alliance-content-border);
}

.operation-form-btn.secondary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--alliance-content-bg);
    border-color: var(--alliance-primary);
    color: var(--alliance-primary);
}

.operation-form-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #0f1f3d;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 15px -10px rgba(15, 31, 61, 0.65);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.operation-form-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -12px rgba(15, 31, 61, 0.65);
}

.operation-form-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 2px solid var(--alliance-primary-light);
    border-top-color: var(--alliance-primary);
    vertical-align: -0.15em;
    margin-right: 0.45em;
    animation: operation-form-spin 640ms linear infinite;
}

@keyframes operation-form-flip-in {
    0% {
        transform: perspective(1200px) rotateX(18deg) translateY(60px) scale(0.92);
        opacity: 0;
    }
    60% {
        transform: perspective(1200px) rotateX(-3deg) translateY(-6px) scale(1.01);
        opacity: 1;
    }
    100% {
        transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes operation-form-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 720px) {
    .operation-form-overlay {
        padding: 1.25rem;
    }

    .operation-form-card {
        border-radius: 14px;
    }

    .operation-form-header,
    .operation-form-body,
    .operation-form-footer {
        padding-inline: 1.5rem;
    }

    .operation-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .operation-form-btn {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .operation-form-card {
        animation: none;
    }

    .operation-form-btn,
    .operation-form-close {
        transition: none;
    }
}

.operation-form-summary {
    display: grid;
    gap: 0.75rem;
}

.operation-form-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: rgba(20, 36, 75, 0.04);
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.operation-form-summary__row span {
    font-size: 0.82rem;
    color: #64748b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.operation-form-summary__row strong {
    font-size: 1rem;
    color: #0f1f3d;
}

/* Oculta el botón nativo de revelar/limpiar contraseña (Edge/Chrome)
   dentro de los campos que ya tienen su propio "ojito". Evita el doble ojito. */
.password-input-group input::-ms-reveal,
.password-input-group input::-ms-clear {
    display: none !important;
    width: 0;
    height: 0;
}
